PRODUCT






Home









Free Download








Installation Instructions





FAQ





FAQ








Ask A Question





LEARN SCRIPTING





Overview








Lesson 1








2


3


4


5








Exam





SAMPLE SCRIPTS





Computer








Internet








Administrators








Developers








Data








Miscellaneous





HELP / DOCUMENTATION





Commands








Automated Internet








Automated Editors








Sample Scripts








Precompiled Functions








System Features






  Help Page - script

( Some help pages may not display correctly in html because those help pages may have sample code
in them, part of which may be mis-interpreted as html tags.

All help pages, including this help page, are available in biterScripting with the help command. )




Command script Purpose Executes commands in a script file. Aliases sscript, scr Syntax script [ <options> ] <name> [ [<var_name> ( <var_value> )] [<var_name> ( <var_value> )] ... ] Options -l List commands. With this options, commands read from the script file (including comments) are listed on Stream Error. NOTE: If you are getting errors from your script, and don't know which lines are producing those errors, call the script command using this option, so that the command lines will be listed along with errors. The command line IMMEDIATELY ABOVE THE ERROR is the offending line. -p Parse only. With this option, this script is parsed (and any errors listed). The script is, however, not executed. This option is useful when first developing a new script. The -l option needs to be specified if you want to see the listing and errors. Arguments <name> Name of the script file. This name can have relative or absolute path. Parameters (arguments) to the script are passed as <var_name> and <var_value> using FVA (Forward Variable Assignment). <var_name> Name of a variable. If this name is preceeded by $, the variable is assumed to be declared already outside the script. If the name is not preceeded by $, the variable is assumed to be declared inside the script. <var_value> Value of the variable <var_name>. This can be a constant, variable (must have $ sign, that means already declared), expression, inline command, another function. Stream Input Stream input to the script command is fed as stream input to the first command within the script. Stream Output Stream output from the executed commands is produced. Stream Error In interactive mode, The lines read within the script are reported here, if the -l option is specified. Any errors encountered are also listed here. Description Commands in script file are executed. Stream redirection is allowed. If the redirection is specified using >>, output from all commands within the script file is appended to the redirection target. If redirection is specified using >, output from all commands within the script file is written over the redirection target. Of course, to provide flexibility, individual commands within the script file can have their own redirection, which takes precedence over the redirection specified on the script command. This command uses the system variable $path to search for the files containing scripts. This is a str variable, and its value has the following syntax " <directory> [ | <directory> [ | <directory> [ ... ] ] ] " Directories within this variable are separated by the pipe character (|) . There should be no extraneous spaces in the value of $path variable. When a script command is encountered, each directory in this list is searched from beginning to end for the specified script. The first script found is executed. It is recommended that you set the value of $path in the startup script based on the needs of your project. The $path variable can contain relative paths, but absolute paths are highly recommended. IMPORTANT: The $path variable CAN CONTAIN Internet locations such as "http://www.mycompany.com/scripts", if you execute scripts from the internet. Restrictions File patterns are not allowed when calling a script for one specific reason. If file patterns are used inadvertantly, it may produce undesired retults. For that reason, the script command forces the user to explicitly specify the name of the file containing the script. In batch mode, the lines read within the script are NOT reported to stream error. Functions declared within a script are available outside of the script (since all functions are always global). However, variables declared inside a script remain local to the script and are not available outside. To make these variables available outside, use the -g option in the var command, which will make them global. A script can not call itself recursively. Similarly, two scripts can not call each other mutually. Valid Examples script myscript.txt Will execute commands in file myscript.txt. script "C:\script_directory\myscript.txt" Will execute commands in file myscript.txt in directory C:\script_directory\ The following example shows the difference between Current Variable Assignment (assigning values to variables already declared) and FVA or Forward Variable Assignment (assigning values to variables NOT declared yet). var int custNo ... script myscript.txt custNo(5) custName("John Doe") Variable custNo is already declared. Before execution begins, variable $custNo will be assigned value 5. $custNo will retain this value after completion of script execution, unless the script changes its value during its execution. Variable custName is not declared outside of the script. So, it will be assumed to be declared within the script. If so, the value "John Doe" will be assigned to $custName before execution of the script. Variable $custName will NOT be available outside of the script. Invalid Examples script *.scr The intention is to execute scripts in files whose names match the pattern *.scr. This will produce an error. script "*.scr" Will also produce an error. We do not allow file patterns within the script command to prevent unintentional execution of commands in script files. However, the following will work. See Also do exit inline mf systemvar

© 2008-2010, biterScripting.com. All rights reserved.
biterScripting, biterScript, biterBrowser, biterScripting.com, FVA (Forward Variable Assignment) are trademarks of biterScripting.com. Is it biterScripting-compatible ? is a service mark of biterScripting.com. Explorer, Unix, Windows are trademarks, service marks or other forms of intellectual property of their respective owners.