PRODUCT |

|

|
|
|

|
|
|
|
|
|
|
|
|
FAQ |
|
|

|
|
|
|
|
|
|
|
|
|
LEARN SCRIPTING |
|
|

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SAMPLE SCRIPTS |
|
|
|

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HELP / DOCUMENTATION |
|
|

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
Help Page - do
( 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
do, done
Purpose
Creates and executes a block of commands.
Aliases
None
Syntax
do
[<command>]
[<command>]
[<command>]
...
done
Options
None.
Stream Input
Ignored.
Stream Output
None.
Stream Error
Any errors from the do and done commands are listed.
Description
do...done is a programming construct that allows to combine
a collection of commands into one block. This collection of
commands is called a do block.
Variable can be declared within a do block. These variables
remain local to the do block and are not available outside.
Variable overloading is permitted - variables with the same
name as global variables can be declared within a do block.
If these overloaded variables are used within the do block,
their local type and value are used, instead of their global
type and value.
Do blocks are typically used in conjunction with other
programming constructs such as if, else, while.
However stand-alone do blocks are allowed and can be
used to limit the scope of certain variables.
This improves programming clarity.
When reporting commands, commands within a do block
are indented by 1. The indent string is defined in system
var $indent.
Restrictions
Stream redirection is not allowed on do and done commands.
However, commands within the do block can have their
individual redirections.
Valid Examples
var int i
set $i=1
while ($i <= 10)
do
echo $i
set $i=$i+1
done
Will print values 1 thru 10.
Please note that the .... is inserted automatically
and is not to be entered on the command line.
Invalid Examples
Consider that the following are the last two lines in a script.
do
echo "inside do"
This will produce an error indicating that there is an unmatched do
within the script.
See Also
continue
script
if
while
indent
|
|
|
© 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.
|
|