include files

Sep 26, 2008
2
0
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
 
May 20, 2008
3,515
4
Elkridge, MD, USA
JP Software Forums" <neil@jpsoft.com>; "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
473
2
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
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
 
Similar threads
Thread starter Title Forum Replies Date
M How to? A probably stupid question re "@Files" and Include Lists... Support 2
Joe Caverly Update ENDLOCAL to include LIBRARY Support 0
S How to? Use wild cards in include list without duplicate processing Support 49
A Include lists and Unicode Support 1
MickeyF TCC crashing when copying multiple files (now resolved) Support 6
fpefpe How to? shortcuts and batch files Support 4
C v28 key files Support 2
J ffind does not find files Support 4
C duplicate files in multiple plugin sites Support 9
Dmitry L. Kobyakov Fixed The SETARRAY /R command works incorrectly with cyrillic files Support 2
S How to? Deinstalling TC/reinstating execution of bat files by cmd in Win7 Support 31
vefatica FFIND, temp files? ... not deleted? Support 0
R FUNCTION to count NUMBER of files matching a pattern and specific length/not length Support 4
vefatica Tmp files from in-process pipes not deleted Support 6
vefatica Finding files with alternate data streams? Support 4
rps Multi-column DIR /v not displaying all files. Support 5
D How to skip files in a fileset? Support 6
vefatica PIPEVIEW leaves TMP files Support 18
K "copy /z /w" command not deleting read-only files in destination Support 10
Jesse Heines "Taken" date for JPG and PNG files Support 4
O I cannot use links to .btm files Support 5
C How to? rename files with spaces Support 8
R How to? Append files in multiple subfolders using copy? Support 8
Joe Caverly "Functions" in cmd.exe batch files Support 6
S Batch files Calling Batch Files Support 2
vefatica Find Files/Text dialog: does it work? Support 0
Joe Caverly UNZIPping older .ZIP files Support 3
C Documentation default location for LOG files Support 21
P exit /b in batch files Support 7
P Labels in batch files: TCC vs CMD.exe Support 9
M ANSI is used to show files instead of OEM in version 17 to 19 ! Support 5
C 7Z files on forum? Support 0
x13 Problem listing repository files using DIR http(s)://... Support 8
B Can copy command concatenate multiple mp3 files Support 2
redwdc Copying files with spaces, commas, etc. Support 5
J New lexer for TCC batch files. Support 0
M How to? want to download a file from a website enumarate the links and download the files Support 2
keithg1964 TCC RT Install Files Support 1
P Fixed Rexx .cmd files no longer work in TCC 20 Support 3
thorntonpg Handling files with embedded spaces Support 1
WavSlave Fixed Unable to sort files by description in TCC v19 Support 2
P Files older - exist Support 1
D safe delete files command Support 10
P Copying files in subdirectories Support 9
C WAD VIEW print multiple files - switches fail Support 10
MikeBaas How to? SELECT: exclude files / display prompt Support 2
Phileosophos WAD Can't rename files in subfolders Support 1
nickles WAD del unable to delete files ending in "." Support 18
P Rename files with ampersand in the name Support 1
C Touch command — I Need to touch matching files in another directory. Support 5

Similar threads