include files

Sep 26, 2008
2
0
#1
Hi,
I would like to know if it is possible to include files in a 4NT script like you can do in C++ with

#include<iostream.h>

something like that.

Best Regards
Luis Daniel A. Lewis

P.S. I use right now Version 6.01 and I am considering to upgrade to Version 9
 
#3
JP Software Forums" <[email protected]>; "luislewis wrote:
| Hi,
| I would like to know if it is possible to include files in a 4NT
| script like you can do in C++ with
|
| #include<iostream.h>
|
| something like that.

"Include" is useful in source files that are compiled into executable
programs. Batch programs, stored in batch files, are interpreted and
executed one command at a time. For over 15 years (since the very first
version of 4NT) the CALL command (as mentioned by Charles Dye) has been
available to execute another batch program in the middle of the current one,
and continue. The called program can contain nothing more than
initialization of variables for the calling program if so desired, but you
must be aware of the scope of variables, esp. if you use SETLOCAL and
explicit or implicit ENDLOCAL.
--
HTH, Steve
 
May 20, 2008
450
2
#5
As has been mentioned, you can use the GOSUB command to call into another batch file. One way to use this functionality as an 'include' is to have an Init in the other batch file that sets up the aliases and functions referenced in that batch file. Take a look at my Array Simulation example in the Tips and Tricks\T&T - Scripting forum. It has an Array.btm as an include/lib that is then used by ArrayTest.btm. The URL BB codes must be turned off, but if you can't find it, here is the link to that post: http://www.jpsoft.com/forums/showthread.php?t=141
 
Sep 26, 2008
2
0
#6
As has been mentioned, you can use the GOSUB command to call into another batch file. One way to use this functionality as an 'include' is to have an Init in the other batch file that sets up the aliases and functions referenced in that batch file. Take a look at my Array Simulation example in the Tips and Tricks\T&T - Scripting forum. It has an Array.btm as an include/lib that is then used by ArrayTest.btm. The URL BB codes must be turned off, but if you can't find it, here is the link to that post: http://www.jpsoft.com/forums/showthread.php?t=141
Hi Tim,
Thanks for your answer, I have tried to used but withow any results. I will continue trying and I will get back to you.
Thanks again.
Best Regard.
Daniel