nld and noft Manual
nld and noft Manual—520384-003
A-1
A Sample nld and noft Session
This appendix demonstrates basic nld and noft commands. The examples are
shown in the Guardian environment, but results would be virtually identical in the Open
Systems Services (OSS) environment. The example source code is compiled with
TNS/R native C compiler.
Subsections:
•
Example Program on page A-1
•
Compilation Commands on page A-6
•
nld Command Examples on page A-7
•
Program Output on page A-8
•
noft Command Examples on a Linkfile on page A-9
•
noft Command Examples on a Loadfile on page A-15
Example Program
The example program is a simplified bus simulation. A random number of passengers
is set at each bus stop. At each bus stop, a random number of passengers get off the
bus and as many passengers as possible get on the bus. The number of passengers
getting on is limited by the number of available seats on the bus and the number of
passengers at the bus stop. There might not be enough passengers at the bus stop to
fill the bus, or there might be more passengers at the bus stop than available seats.
After the bus is loaded, the number of people remaining at the bus stop is calculated.
At the last bus stop, the number of people on the bus and the number of passengers
remaining at each stop is displayed.
DEFINEs set the following parameters to the following values:
The example program consists of four modules, or compilation units: three source
modules and a user library. The names of the source modules are MAINC,
MODULE1C, and MODULE2C. The name of the user library is UTILC. The program
also uses two global variables, passengers_on_bus and bus_stop_array, and
two SRLs, ZCRESRL and ZCRTLSRL.
Parameter Value
Number of bus stops 5
Maximum number of passengers at each bus stop 50
Maximum number of seats on the bus 44