A while loop will keep running everything inside it's execution block (the code between the
{ }'s) as long as the condition is true.
For example this code:
var %i = 1
while (%i <= 4) {
echo 2 %i
inc %i
}
echo This echo is outside the while loop
would run like this line-by-line:
Assign 1 to %i
Check while loop condition... (1 <= 4) is [color:green]trueOutput %i
Increment %i by 1
Check while loop condition... (2 <= 4) is
trueOutput %i
Increment %i by 1
Check while loop condition... (3 <= 4) is
trueOutput %i
Increment %i by 1
Check while loop condition... (4 <= 4) is
trueOutput %i
Increment %i by 1
Check while loop condition... (5 <= 4) is
falseOutput 'This echo is outside the while loop'[/color]
The 46 in
$gettok(a.b.c.d.e,3,46) is the ASCII number for a fullstop (
.). 32 is the ASCII number for a space. You can get the ASCII number of any character by using
$asc(character here).