vipsi - the friendly vip script interpreter

Appendix

Syntax Cave-ats

Function call without parenthesis

With all Vipsi command syntax: Functions
Functions
Glossary: Function
functions
which take exactly one Vipsi command syntax: Arguments
Glossary: Arguments
argument
, Flow control: if … then
Flow control: try … then
the
Separators: Round brackets "( … )"
Functions with varying return types: bracket expression "()"
parenthesis
may be omitted, Flow control: if … then
Flow control: if … then
if the
Vipsi command syntax: Arguments
Glossary: Arguments
argument
is a simple Glossary: Valuevalue Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
and
no Vipsi command syntax: Expressions
Glossary: Expression
expression
with Vipsi command syntax: Operators
Operators
Glossary: Operator
operators
. Flow control: if … then
Flow control: if … then
If the
Vipsi command syntax: Arguments
Glossary: Arguments
argument
is a Vipsi command syntax: Expressions
Glossary: Expression
expression
, Flow control: if … then
Flow control: try … then
then
you must use Separators: Round brackets "( … )"
Functions with varying return types: bracket expression "()"
parenthesis
.

Numeric functions: sinsin 2*Constants: pipi   ==   Numeric functions: sinsin(2) * Constants: pipi   !=   Numeric functions: sinsin(2*Constants: pipi)
{ .. } in the shell

Separators: Curly brackets "{ … }"
Instructions: Local scope "{}"
Braces
{ ... } are used to enclose ranges of program code with a private Glossary: Variable, var_refvariable scope Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
and
for Literals: List literals
Lists and arrays: List literals
list literals
. List functions: thisThis depends on Flow control: if … then
Flow control: try … then
the
place where they are encountered. Flow control: if … thenIf a Separators: Curly brackets "{ … }"
Instructions: Local scope "{}"
brace
occurs Operators: Make Identifier "@"at Flow control: if … then
Flow control: try … then
the
place of an Vipsi command syntax: Instructions
Instructions
Glossary: Instruction
instruction
Flow control: if … then
Flow control: try … then
then
it starts a private Glossary: Variable, var_refvariable scope. Flow control: if … thenIf a Separators: Curly brackets "{ … }"
Instructions: Local scope "{}"
brace
occurs Operators: Make Identifier "@"at Flow control: if … then
Flow control: try … then
the
position of an Vipsi command syntax: Expressions
Glossary: Expression
expression
Flow control: if … then
Flow control: try … then
then
it is Flow control: if … then
Flow control: try … then
the
beginning of a Literals: List literals
Lists and arrays: List literals
list literal
.

Flow control: if … then
Flow control: try … then
The
only place where List functions: thisthis may lead to confusion is Flow control: if … then
Flow control: try … then
the
vipsi shell: Operators: Make Identifier "@"At Flow control: if … then
Flow control: try … then
the
start of Flow control: if … then
Flow control: try … then
the
command line Flow control: if … then
Flow control: try … then
the
parser expects an Vipsi command syntax: Instructions
Instructions
Glossary: Instruction
instruction
. For your convenience it is also possible to just type an Vipsi command syntax: Expressions
Glossary: Expression
expression
Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
and
Flow control: if … then
Flow control: try … then
the
shell will print Flow control: if … then
Flow control: try … then
the
result. Thus Flow control: if … thenif you just type in

{ x=22, y=1.5, z=0 }

to see whether vipsi evaluates your Literals: List literals
Lists and arrays: List literals
list literal
as expected, Flow control: if … then
Flow control: try … then
then
Flow control: if … then
Flow control: try … then
the
opening { stands Operators: Make Identifier "@"at Flow control: if … then
Flow control: try … then
the
position of an Vipsi command syntax: Instructions
Instructions
Glossary: Instruction
instruction
Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
and
should be handled as Flow control: if … then
Flow control: try … then
the
start of a range of Vipsi command syntax: Statements
Glossary: Statement
statements
with private Glossary: Variable, var_refvariable scope.

As of version 0.8.8 Flow control: if … then
Flow control: try … then
the
shell has some automagic intelligence to detect List functions: thisthis. Flow control: if … thenIf a command line starts with an opening brace { Flow control: if … then
Flow control: try … then
then
Flow control: if … then
Flow control: try … then
the
shell defaults to a Literals: List literals
Lists and arrays: List literals
list literal
, except Flow control: if … thenif it contains a Separators: Semicolon ";"semicolon ";" Operators: Boolean Or with Variable "||="
Operators: Bitwise Or with Variable "|="
Operators: Bitwise Or "|"
Operators: Boolean Or "||"
or
a pure Vipsi command syntax: Instructions
Instructions
Glossary: Instruction
instruction
like Instructions: var
How does VScript::Value() work?: Var*&
var
. List functions: thisThis is done by silently putting a Instructions: putput Vipsi command syntax: Statements
Glossary: Statement
statement
in front of Flow control: if … then
Flow control: try … then
the
Data Types: Lists and arrays
Item selector "[]": Lists
Glossary: list, list_val
list
Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
and
Flow control: if … then
Flow control: try … then
the
printed result is Operators: Bitwise Not "~"
Operators: Boolean Negation "!"
not
always identical to what would be printed Flow control: if … thenif it would have been evaluated as an Vipsi command syntax: Expressions
Glossary: Expression
expression
without glue.

log in the shell

Numeric functions: log
Numeric functions: loge
Instructions: log
log
is used as an Vipsi command syntax: Instructions
Instructions
Glossary: Instruction
instruction
which prints it's Vipsi command syntax: Arguments
Glossary: Arguments
arguments
to Constants: stderrstderr Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
and
as a Vipsi command syntax: Functions
Functions
Glossary: Function
function
to calculate Flow control: if … then
Flow control: try … then
the
logarithm of any Glossary: number, num_valnumber to any Integer numbers: Base 256base. Flow control: if … then
Flow control: try … then
The
meaning depends on Flow control: if … then
Flow control: try … then
the
place where Numeric functions: log
Numeric functions: loge
Instructions: log
log
is encountered. Flow control: if … thenIf it occurs Operators: Make Identifier "@"at Flow control: if … then
Flow control: try … then
the
place of an Vipsi command syntax: Instructions
Instructions
Glossary: Instruction
instruction
Flow control: if … then
Flow control: try … then
then
it is Flow control: if … then
Flow control: try … then
the
Vipsi command syntax: Instructions
Instructions
Glossary: Instruction
instruction
Numeric functions: log
Numeric functions: loge
Instructions: log
log
which prints it Vipsi command syntax: Arguments
Glossary: Arguments
arguments
to Constants: stderrstderr. Flow control: if … thenIf it occurs Operators: Make Identifier "@"at Flow control: if … then
Flow control: try … then
the
place of an Vipsi command syntax: Expressions
Glossary: Expression
expression
Flow control: if … then
Flow control: try … then
then
it is Flow control: if … then
Flow control: try … then
the
Vipsi command syntax: Functions
Functions
Glossary: Function
function
Numeric functions: log
Numeric functions: loge
Instructions: log
log
.

Flow control: if … then
Flow control: try … then
The
only place where List functions: thisthis may lead to confusion is Flow control: if … then
Flow control: try … then
the
vipsi shell: Operators: Make Identifier "@"At Flow control: if … then
Flow control: try … then
the
start of Flow control: if … then
Flow control: try … then
the
command line Flow control: if … then
Flow control: try … then
the
parser expects an Vipsi command syntax: Instructions
Instructions
Glossary: Instruction
instruction
. For your convenience it is also possible to just type an Vipsi command syntax: Expressions
Glossary: Expression
expression
Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
and
Flow control: if … then
Flow control: try … then
the
shell will print Flow control: if … then
Flow control: try … then
the
result. Thus Flow control: if … thenif you just type in

Numeric functions: log
Numeric functions: loge
Instructions: log
log
(2,8)

to see what Flow control: if … then
Flow control: try … then
the
logarithm of 8 to Integer numbers: Base 256base 2 is, Flow control: if … then
Flow control: try … then
then
Flow control: if … then
Flow control: try … then
the
List functions: words
Shell Immediate Commands: words
word
Numeric functions: log
Numeric functions: loge
Instructions: log
log
stands Operators: Make Identifier "@"at Flow control: if … then
Flow control: try … then
the
position of an Vipsi command syntax: Instructions
Instructions
Glossary: Instruction
instruction
Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
and
should be handled as Flow control: if … then
Flow control: try … then
the
Vipsi command syntax: Instructions
Instructions
Glossary: Instruction
instruction
Numeric functions: log
Numeric functions: loge
Instructions: log
log
.

As of version 0.8.8 Flow control: if … then
Flow control: try … then
the
shell has some automagic intelligence to detect List functions: thisthis. Flow control: if … thenIf a command line starts with Numeric functions: log
Numeric functions: loge
Instructions: log
log
Flow control: if … then
Flow control: try … then
then
Flow control: if … then
Flow control: try … then
the
shell inspects Flow control: if … then
Flow control: try … then
the
Flow control: nextnext token. Flow control: if … thenIf it is an opening Separators: Round brackets "( … )"
Functions with varying return types: bracket expression "()"
parenthesis
( Flow control: if … then
Flow control: try … then
then
Flow control: if … then
Flow control: try … then
the
shell defaults to an Vipsi command syntax: Expressions
Glossary: Expression
expression
Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
and
Numeric functions: log
Numeric functions: loge
Instructions: log
log
will be handled as Flow control: if … then
Flow control: try … then
the
logarithm Vipsi command syntax: Functions
Functions
Glossary: Function
function
. List functions: thisThis is done by silently putting a Instructions: putput Vipsi command syntax: Instructions
Instructions
Glossary: Instruction
instruction
in front of Numeric functions: log
Numeric functions: loge
Instructions: log
log
Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
and
Flow control: if … then
Flow control: try … then
the
printed result is Operators: Bitwise Not "~"
Operators: Boolean Negation "!"
not
always identical to what would be printed Flow control: if … thenif it was evaluated as an Vipsi command syntax: Expressions
Glossary: Expression
expression
without glue.

Statements starting with '%', '-' or '+'

Flow control: if … thenIf a Vipsi command syntax: Statements
Glossary: Statement
statement
after a Vipsi command syntax: Statements
Glossary: Statement
statement
with Vipsi command syntax: Arguments
Glossary: Arguments
arguments
starts with '-', '+' Operators: Boolean Or with Variable "||="
Operators: Bitwise Or with Variable "|="
Operators: Bitwise Or "|"
Operators: Boolean Or "||"
or
'%' Flow control: if … then
Flow control: try … then
then
List functions: thisthis character is Operators: Bitwise Not "~"
Operators: Boolean Negation "!"
not
recognized as a Glossary: number, num_valnumber Numeric functions: signsign start of a Integer numbers: Binary
Floating point: Binary
Text functions: binstr
binary
Literals: Number literals
Numbers: Number literals
number literal
but interpreted as Vipsi command syntax: Operators
Operators
Glossary: Operator
operator
Operators: Subtract "-"minus, Operators: Add "+"plus Operators: Boolean Or with Variable "||="
Operators: Bitwise Or with Variable "|="
Operators: Bitwise Or "|"
Operators: Boolean Or "||"
or
Operators: Remainder with Variable "%="
Operators: Remainder "%"
remainder
linking it to Flow control: if … then
Flow control: try … then
the
last Vipsi command syntax: Arguments
Glossary: Arguments
argument
of Flow control: if … then
Flow control: try … then
the
previous Vipsi command syntax: Instructions
Instructions
Glossary: Instruction
instruction
.

List functions: thisThis will almost certainly happen only in broken code.

In a sane program, each Vipsi command syntax: Statements
Glossary: Statement
statement
starts with an Vipsi command syntax: Identifiers (names)
Identifiers, names
Operators: Make Identifier "@"
Glossary: Name, Identifier
identifier
Vipsi command syntax: Identifiers (names)
Identifiers, names
Operators: Make Identifier "@"
Text functions: name
Glossary: Name, Identifier
name
:

Flow control: if … thenIf a Vipsi command syntax: Statements
Glossary: Statement
statement
starts with '%', '+' Operators: Boolean Or with Variable "||="
Operators: Bitwise Or with Variable "|="
Operators: Bitwise Or "|"
Operators: Boolean Or "||"
or
'-', Flow control: if … then
Flow control: try … then
then
List functions: thisthis Vipsi command syntax: Expressions
Glossary: Expression
expression
will Flow control: returnreturn a result Glossary: Valuevalue. In a Example Scripts: CGI Scripts
Example Scripts: Scripts
script
List functions: thisthis result Glossary: Valuevalue will be discarded. I can hardly think of any useful code, with a Vipsi command syntax: Statements
Glossary: Statement
statement
beginning with a numeric Glossary: Valuevalue. Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
And
all examples i can imagine are lunatic Operators: Boolean Or with Variable "||="
Operators: Bitwise Or with Variable "|="
Operators: Bitwise Or "|"
Operators: Boolean Or "||"
or
malicious.

#!/usr/local/bin/vipsi
// very broken:
    +123 Instructions: var
How does VScript::Value() work?: Var*&
var
a=0 -123 Instructions: var
How does VScript::Value() work?: Var*&
var
b=0 +123 Instructions: var
How does VScript::Value() work?: Var*&
var
c=0 %011 Instructions: putput Constants: nlnl, "-> ", a, Constants: tabtab, b, Constants: tabtab, c, Constants: nlnl // very insane: Instructions: procproc mySideEffect(a){ Instructions: putput a; Flow control: returnreturn a } Instructions: putput 222 +mySideEffect(77)

Even in Flow control: if … then
Flow control: try … then
the
shell Flow control: if … thenif you want to print Flow control: if … then
Flow control: try … then
the
result of an Vipsi command syntax: Expressions
Glossary: Expression
expression
, Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
and
Flow control: if … then
Flow control: try … then
the
Vipsi command syntax: Expressions
Glossary: Expression
expression
starts with a Literals: Number literals
Numbers: Number literals
number literal
which starts with '%', '+' Operators: Boolean Or with Variable "||="
Operators: Bitwise Or with Variable "|="
Operators: Bitwise Or "|"
Operators: Boolean Or "||"
or
'-', List functions: thisthis is no problem, because you'll rarely append such a calculation after another Vipsi command syntax: Instructions
Instructions
Glossary: Instruction
instruction
with Vipsi command syntax: Arguments
Glossary: Arguments
arguments
. List functions: thisThis would look pretty insane:

vipsi> Instructions: putput 100  -123  -23
vipsi> Instructions: putput 100  +123  223
vipsi> Instructions: putput 100  %011  1
vipsi>  

Flow control: if … thenIf you successfully construct a case where it matters, use Instructions: putput Operators: Boolean Or with Variable "||="
Operators: Bitwise Or with Variable "|="
Operators: Bitwise Or "|"
Operators: Boolean Or "||"
or
enclose it in Separators: Round brackets "( … )"
Functions with varying return types: bracket expression "()"
parenthesis
:

vipsi> Flow control: if … then
Flow control: if … then
if 1 -123 then
/* prints nothing */
vipsi> Flow control: if … thenif 1 Instructions: putput -123 Flow control: if … then
Flow control: try … then
then
-123 vipsi> Flow control: if … then
Flow control: if … then
if 1 (-123) then
-123 vipsi> Flow control: if … then
Flow control: if … then
if 1; -123 then
-123 vipsi>
return and end with no return value

These two Vipsi command syntax: Instructions
Instructions
Glossary: Instruction
instructions
are special in Flow control: if … then
Flow control: try … then
the
way, that they are Flow control: if … then
Flow control: try … then
the
only Vipsi command syntax: Instructions
Instructions
Glossary: Instruction
instructions
which can optionally take no Operators: Boolean Or with Variable "||="
Operators: Bitwise Or with Variable "|="
Operators: Bitwise Or "|"
Operators: Boolean Or "||"
or
one Vipsi command syntax: Arguments
Glossary: Arguments
argument
. All other Vipsi command syntax: Instructions
Instructions
Glossary: Instruction
instructions
can take either no Operators: Boolean Or with Variable "||="
Operators: Bitwise Or with Variable "|="
Operators: Bitwise Or "|"
Operators: Boolean Or "||"
or
Operators: Make Identifier "@"at least one Vipsi command syntax: Arguments
Glossary: Arguments
argument
. List functions: thisThis is important for Flow control: if … then
Flow control: try … then
the
parser, because it must know whether Flow control: if … then
Flow control: try … then
the
Vipsi command syntax: Expressions
Glossary: Expression
expression
after an Vipsi command syntax: Instructions
Instructions
Glossary: Instruction
instruction
must be interpretet as an Vipsi command syntax: Arguments
Glossary: Arguments
argument
to that Vipsi command syntax: Instructions
Instructions
Glossary: Instruction
instruction
Operators: Boolean Or with Variable "||="
Operators: Bitwise Or with Variable "|="
Operators: Bitwise Or "|"
Operators: Boolean Or "||"
or
as a Instructions: newnew Vipsi command syntax: Instructions
Instructions
Glossary: Instruction
instruction
, even Flow control: if … thenif it yields a result. Flow control: if … then
Flow control: try … then
The
latter case is very common, because Flow control: if … then
Flow control: try … then
the
Operators: Assignment "="
Built-in operators: Assignments:
assignment
Vipsi command syntax: Operators
Operators
Glossary: Operator
operators
all Flow control: returnreturn Flow control: if … then
Flow control: try … then
the
assigned Glossary: Valuevalue (acually a reference to Flow control: if … then
Flow control: try … then
the
Glossary: Variable, var_refvariable) as result! Therefore:

Instructions: putput a=22

will Operators: Assignment "="assign 22 to a Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
and
print Flow control: if … then
Flow control: try … then
the
result, which is 22. Flow control: whileWhile

Instructions: putput "x" a=22

will print "x" but Operators: Bitwise Not "~"
Operators: Boolean Negation "!"
not
Flow control: if … then
Flow control: try … then
the
result of Flow control: if … then
Flow control: try … then
the
Operators: Assignment "="
Built-in operators: Assignments:
assignment
a=22, because that is a Instructions: newnew Vipsi command syntax: Instructions
Instructions
Glossary: Instruction
instruction
. Flow control: if … thenIf you wanted to print both, "x" Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
and
"22", Flow control: if … then
Flow control: try … then
then
you needed to append a=22 with a Separators: Comma ","comma "," to Flow control: if … then
Flow control: try … then
the
Vipsi command syntax: Arguments
Glossary: Arguments
argument
Data Types: Lists and arrays
Item selector "[]": Lists
Glossary: list, list_val
list
of Instructions: putput.

Additionally, Flow control: if … then
Flow control: if … then
if the
Flow control: nextnext Vipsi command syntax: Instructions
Instructions
Glossary: Instruction
instruction
is self-defined Vipsi command syntax: Procedures
Data Types: Procedures
Glossary: Procedure
procedure
, Flow control: if … then
Flow control: try … then
the
parser Flow control: do … loopdoes Operators: Bitwise Not "~"
Operators: Boolean Negation "!"
not
know
whether it will Flow control: returnreturn a result Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
and
assume that it will. List functions: thisThis makes no difference for a Vipsi command syntax: Procedures
Data Types: Procedures
Glossary: Procedure
procedure
written Operators: Make Identifier "@"at Flow control: if … then
Flow control: try … then
the
place of an Vipsi command syntax: Instructions
Instructions
Glossary: Instruction
instruction
, because either it Flow control: do … loopdoes Operators: Bitwise Not "~"
Operators: Boolean Negation "!"
not
Flow control: returnreturn a result Operators: Boolean Or with Variable "||="
Operators: Bitwise Or with Variable "|="
Operators: Bitwise Or "|"
Operators: Boolean Or "||"
or
Flow control: if … then
Flow control: try … then
the
returned result will be discarded. (Operators: Bitwise Not "~"
Operators: Boolean Negation "!"
note
: on Flow control: if … then
Flow control: try … then
the
vipsi shell printed for your convenience.)

Therefore Flow control: if … then
Flow control: try … then
the
parser has a little problem with Flow control: returnreturn Operators: Boolean Or with Variable "||="
Operators: Bitwise Or with Variable "|="
Operators: Bitwise Or "|"
Operators: Boolean Or "||"
or
Flow control: end
Shell Immediate Commands: exit, quit, end
end
, which may Operators: Boolean Or with Variable "||="
Operators: Bitwise Or with Variable "|="
Operators: Bitwise Or "|"
Operators: Boolean Or "||"
or
may Operators: Bitwise Not "~"
Operators: Boolean Negation "!"
not
be followed by an Vipsi command syntax: Arguments
Glossary: Arguments
argument
. How to decide? Flow control: if … then
Flow control: try … then
The
stunning fact is, it's Shell Immediate Commands: exit, quit, endquite easy: Because both Vipsi command syntax: Instructions
Instructions
Glossary: Instruction
instructions
break from Flow control: if … then
Flow control: try … then
the
program flow, Flow control: if … then
Flow control: try … then
the
Flow control: nextnext Vipsi command syntax: Instructions
Instructions
Glossary: Instruction
instruction
won't be executed. Therefore in a proper program Flow control: if … then
Flow control: try … then
the
Flow control: nextnext Vipsi command syntax: Instructions
Instructions
Glossary: Instruction
instruction
can only be a switching Operators: Boolean Or with Variable "||="
Operators: Bitwise Or with Variable "|="
Operators: Bitwise Or "|"
Operators: Boolean Or "||"
or
terminating Vipsi command syntax: Flow control
Flow control
flow control
List functions: words
Shell Immediate Commands: words
word
: Flow control: if … then
Flow control: try … then
else
, Flow control: if … thenelif, Flow control: if … then
Flow control: try … then
then
Operators: Boolean Or with Variable "||="
Operators: Bitwise Or with Variable "|="
Operators: Bitwise Or "|"
Operators: Boolean Or "||"
or
Flow control: do … looploop. Every other List functions: words
Shell Immediate Commands: words
word
makes no sense. So Flow control: if … then
Flow control: try … then
the
Flow control: returnreturn Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
and
Flow control: end
Shell Immediate Commands: exit, quit, end
end
handler just test, whether Flow control: if … then
Flow control: try … then
the
Flow control: nextnext List functions: words
Shell Immediate Commands: words
word
is one of those List functions: words
Shell Immediate Commands: words
words
(actually they test for 'Invariants: Built-in instructionsbuilt-in instruction returning no Glossary: Valuevalue') Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
and
Flow control: returnreturns with no result Operators: Boolean Or with Variable "||="
Operators: Bitwise Or with Variable "|="
Operators: Bitwise Or "|"
Operators: Boolean Or "||"
or
evaluates Flow control: if … then
Flow control: try … then
the
following Vipsi command syntax: Expressions
Glossary: Expression
expression
.

There is no problem. Except in one situation, which stunningly often happens to me:

When a program fails somehow Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
and
i debug it, i often Instructions: putput in a Flow control: returnreturn somewhere. Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
And
that position, self-evidently is Operators: Bitwise Not "~"
Operators: Boolean Negation "!"
not
before one of Flow control: if … then
Flow control: try … then
the
terminating Vipsi command syntax: Flow control
Flow control
flow control
List functions: words
Shell Immediate Commands: words
word
. Frequently enough before a Functions with varying return types: call
Instructions: call
call
to a self-defined Vipsi command syntax: Procedures
Data Types: Procedures
Glossary: Procedure
procedure
Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
and
Flow control: if … then
Flow control: try … then
then
Flow control: if … then
Flow control: try … then
the
Vipsi command syntax: Procedures
Data Types: Procedures
Glossary: Procedure
procedure
Functions with varying return types: call
Instructions: call
call
after Flow control: if … then
Flow control: try … then
the
Flow control: returnreturn unexpectedly Instructions: getgets called before Flow control: returnreturn Flow control: returnreturns, just because Flow control: if … then
Flow control: try … then
the
parser assumes that it delivers an Vipsi command syntax: Arguments
Glossary: Arguments
argument
. Puzzled me sometimes.

From a real-world case:

Instructions: procproc Doit()
{
    QuelltextEinlesen()
    TagsAbtrennen()
    Flow control: returnreturn                  // <-- inserted for testing
    TagsBehandeln()
    AnkerErzeugen()
    QuerverweiseEinfügen()
    BuchNachHtmlKonvertieren()
    BuchdateienSchreiben()
}

In Flow control: if … then
Flow control: try … then
the
case above Flow control: if … then
Flow control: try … then
the
Vipsi command syntax: Procedures
Data Types: Procedures
Glossary: Procedure
procedure
TagsBehandeln() was called despite Flow control: if … then
Flow control: try … then
the
Flow control: returnreturn in front of it. List functions: thisThis is, as you can see, because i never terminate my Vipsi command syntax: Instructions
Instructions
Glossary: Instruction
instructions
with Separators: Semicolon ";"semicolons ";" as i should Flow control: do … loopdo. Just adding a Separators: Semicolon ";"semicolon ";" after Flow control: if … then
Flow control: try … then
the
Flow control: returnreturn did remedy Flow control: if … then
Flow control: try … then
the
problem.

var argc = count globals - 1

Ever wondered why there is 1 subtracted when storing Flow control: if … then
Flow control: try … then
the
Numeric functions: countcount of List functions: globals
Shell Immediate Commands: globals
global
Glossary: Variable, var_refvariables into a Glossary: Variable, var_refvariable, which frequently happens to be named argc?

It's no bug, work-around Operators: Boolean Or with Variable "||="
Operators: Bitwise Or with Variable "|="
Operators: Bitwise Or "|"
Operators: Boolean Or "||"
or
even an ambiguity, it's just that Numeric functions: countcount List functions: globals
Shell Immediate Commands: globals
globals
is executed after Instructions: var
How does VScript::Value() work?: Var*&
var
argc
, Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
and
therefore Flow control: if … then
Flow control: try … then
the
Glossary: Variable, var_refvariable argc already Numeric functions: existsexists when Numeric functions: countcount Numeric functions: countcounts Flow control: if … then
Flow control: try … then
the
Glossary: number, num_valnumber of List functions: globals
Shell Immediate Commands: globals
global
Glossary: Variable, var_refvariables. So Flow control: if … then
Flow control: try … then
the
Numeric functions: countcount will Functions with varying return types: include
Instructions: include
include
Glossary: Variable, var_refvariable argc Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
and
we Operators: Subtract from Variable "-="
Operators: Subtract "-"
subtract
1 for that fact.

Just to Operators: Bitwise Not "~"
Operators: Boolean Negation "!"
note
it somewhere.

Valid HTML   Valid CSS