LIBRARY command (ver 22)

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
Oct 18, 2009
109
4
#1
Several things about the new LIBRARY command:

1) The files don't require a particular extension. I tried a test file named LIBRARY_FILES.txt and it loaded.

Show_Library {
@echo off
Echo This is the Show_Libary function in LIBRARY_FILES.txt
pause
}


2) Contents of a function are autonomous.

That means that the function code for each function must begin with @echo off. If it doesn't, the commands will display, the same as if a batch file did not begin with that. I put @echo off before the function definition and it had no effect. (WAD)
 
#2
Library functions do, however, respect
Code:
BatchEcho=No
which has been in my INI file for ~25 years. It's a lot easier to use
Code:
echo on
in the rare occasion when it's desired.
 
Oct 18, 2009
109
4
#3
Passing parameters:

With_Params{
@echo off
Echo This is the With_Params function in LIBRARY_FILES.txt
echo %1
echo %2
echo %3
pause
}


Command line: With_Params ABC DEF GHI