Avoiding Pitfalls in Multi-Language Programming
these run in block mode, you must redirect I/O to a hardwired terminal
before running the program.
To redirect I/O for VPLUS applications, get the file name used for the terminal (eg.,
the RPG program
F-spec defining the workstation). File equate
this name to the LDEV number of the hardwired
terminal. For RSI applications, the name RSIIO must be file equated to the hardwired terminal LDEV.
Transact supports its own debugging
subsystem, TRANDEBUG. You must compile your program
with the
"TRANDEBUG" compiler option to allow debugging via TRANDEBUG.
TRANDEBUG can be
disabled without recompiling the program by
setting the system variable "TRANDEBUG" off via a
SETVAR TRANDEBUG, "OFF" command. TRANDEBUG single-stepping returns
control after each
Transact statement, except in the case of LIST or DATA statements,
which return control after each data item is
loaded into the list or data register. TRANDEBUG does
not support other programming languages, such as Cobol, Fortran or
Pascal, but allows you to invoke
NMDEBUG for this purpose.
Basic does not support XDB or Toolset. Debug
the Basic portion of your program from the interpreter,
or use NMDEBUG or XDB to debug compiled code in assembly mode. To do
assembly level
debugging, use the COPTION LIST,ID,LABEL options when compiling your Basic program.
LIST - enables ID and LABEL. This is the default.
ID - Prints a table of identifiers, types, and addresses.
LABEL - Prints a table of program line
numbers and their code offsets. Assembly code can be
dumped during compilation using ;info="#-da" in the compiler runstring.
Pitfalls:
Do not use MARK and RELEASE to free heap
space if routines in foreign languages are called.
Pascal, C, Fortran, and Basic use the heap to store data that is expected
to be preserved between
invocations.
Posix Environment
Pitfalls:
New HFS-filenames can cause many problems.
Only the C compiler is supported under the MPE/iX Posix Shell.
Recommendations:
Except for the C language, language
development should be done in the MPE/iX Command
Interpreter environment.
Details:
POSIX has introduced the HFS-syntax to file
names. Valid file names now allow many combinations
that were invalid in the past. Especially beware of file names that use
language suffixes (like .c or .p)
as these file names are often seen as file.group and the groups C or P generally do not exist.
The Pascal compiler does support HFS input
and output file names. However, the file names are
limited to 132 characters. The Pascal Run-time Library is limited to file names of 255 characters.
Basic, COBOL, Fortran, RPG, and Transact do not currently support POSIX file naming conventions.
BIBLIOGRAPHY
Page
12
of
14
Avoiding Pitfalls in Multi
-
Language Programming
7/18/2008
http://www.hp.com/cgi
-
bin/pf
-
new.cgi?IN=http://jazz.external.hp.com/papers/lang/pgm_pi
...