September 5, 2001
==================================================================
>From the Edge: RUN filespec vs. QUIT TO filespec
Section: Memory Management
Chapter: Running R:BASE Your Way!
Platform: R:BASE 2000 (ver 6.5) and Higher (DOS/Windows)
Build: 1.835xRT03 and Higher ...
==================================================================
Creating complex applications with so many command files and
monitoring nesting levels has always been an art of designing
trouble-free applications.
It is the programmer's responsibility to monitor the nesting
level, when using RUN filespec command from within a command
or procedure file.
When you use RUN filespec command from within a command or
procedure file, R:BASE adds one to the nesting level for each
nested command file. RETURN is the only way to exit command
and to return control to the next line in the calling command
file, and the nesting counter decreases by one.
You can nest command files, such as RUN filespec, IF structures,
WHILE loops, and SWITCH structures. The number of control
structures that you can nest depends on the amount of memory
available when the command or procedure file executes.
You can have up to five levels of RUN execution, unless you use
the SET FILES command to change the number of command files
that can be open simultaneously. In other words, command file 1
can execute command file 2, command file 2 can execute command
file 3, command file 3 can execute command file 4, and command
file 4 can execute command file 5. Successive RETURN commands
pass execution control back up through the command files.
It all comes down to defining nesting levels and ... making
sure to return control back to the originating command file.
Using the QUIT TO filespec command, there is no overhead, no
nesting level, nor does R:BASE have to keep track of nesting
levels.
Using the QUIT TO filespec command, you can QUIT TO any
command file at any level you wish and never have to worry
about RETURNing to the last command to return control to the
one command before and so on ...
QUIT TO filespec command clears all nesting levels and resets
the nesting level to 0. Thus, no overhead.
Using R:BASE 2000 (version 6.5+) and higher, you can QUIT TO
individual binary codelocked command file(s) too.
QUIT TO filespec cannot be used to execute a command block
in a procedure file.
My personal preference .. QUIT TO CommandFile.
Total Control ...
Very Best Regards,
Razzak.
===================================-============================
Official R:BASE List Server: mailto:[EMAIL PROTECTED]
RBTI Events/Training: http://www.rbase2000.com/events
R:DCC Members: http://www.rbase2000.com/rdcc
================================================================
R:BASE, Oterro & R:Tango are registered trademarks of RBTI.
==================================-=============================