vipsi - the friendly vip script interpreter

Separators

Comma ","

Separators: Comma ","Commas separate Vipsi command syntax: Arguments
Glossary: Arguments
arguments
for Vipsi command syntax: Instructions
Instructions
Glossary: Instruction
instructions
Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
and
Vipsi command syntax: Procedures
Data Types: Procedures
Glossary: Procedure
procedures
, items in Literals: List literals
Lists and arrays: List literals
list literals
Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
and
Numeric functions: indexindexes in multi-dimensional Data Types: Lists and arrays
Item selector "[]": Lists
Glossary: list, list_val
lists
.

Separate Vipsi command syntax: Arguments
Glossary: Arguments
arguments
of Vipsi command syntax: Instructions
Instructions
Glossary: Instruction
instructions
:

Instructions: putput "a=", a, Constants: nlnl;

Separate Vipsi command syntax: Arguments
Glossary: Arguments
arguments
of Vipsi command syntax: Functions
Functions
Glossary: Function
functions
:

a = Numeric functions: maxmax( b,c );

Separate items in Literals: List literals
Lists and arrays: List literals
list literals
:

Instructions: var
How does VScript::Value() work?: Var*&
var
mylist={"abc","def","ghi"};

Separate Numeric functions: indexindexes in multi-dimensional Data Types: Lists and arrays
Item selector "[]": Lists
Glossary: list, list_val
lists
:

n = mylist[ i,j ];
n = mylist[i][j];   // just Flow control: if … then
Flow control: try … then
the
same

Separate Numeric functions: indexindex in 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
Numeric functions: indexindex in Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
text
of Flow control: if … then
Flow control: try … then
the
so addressed item:

Instructions: var
How does VScript::Value() work?: Var*&
var
mylist={"abc","def"}; a = mylist[1,2]; a = mylist[1][2]; // just Flow control: if … then
Flow control: try … then
the
same Instructions: putput a // prints: b

Semicolon ";"

Flow control: if … then
Flow control: try … then
The
Separators: Semicolon ";"semicolon ";" is used to separate Vipsi command syntax: Statements
Glossary: Statement
statements
. It is optional Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
and
almost never required by Flow control: if … then
Flow control: try … then
the
parser but improves readability of your source.

These following examples are just Flow control: if … then
Flow control: try … then
the
same:

Without ";"

Instructions: var
How does VScript::Value() work?: Var*&
var
i=1 Flow control: do … loopdo Flow control: if … thenif i>100 Flow control: exit
Shell Immediate Commands: exit, quit, end
exit
Flow control: if … then
Flow control: try … then
then
i+=i Flow control: do … looploop Instructions: putput "i = ", i, Constants: nlnl

With ";"

Instructions: var
How does VScript::Value() work?: Var*&
var
i=1; Flow control: do … loopdo; Flow control: if … thenif i>100; Flow control: exit
Shell Immediate Commands: exit, quit, end
exit
; Flow control: if … then
Flow control: try … then
then
; i+=i; Flow control: do … looploop; Instructions: putput "i = ", i, Constants: nlnl;

Best Instructions: writewrite it List functions: thisthis way, with Operators: Boolean Or with Variable "||="
Operators: Bitwise Or with Variable "|="
Operators: Bitwise Or "|"
Operators: Boolean Or "||"
or
without ";":

Instructions: var
How does VScript::Value() work?: Var*&
var
i=1 Flow control: do … loopdo Flow control: if … thenif i>100 Flow control: exit
Shell Immediate Commands: exit, quit, end
exit
Flow control: if … then
Flow control: try … then
then
i+=i Flow control: do … looploop Instructions: putput "i = ", i, Constants: nlnl

Actually sometimes Flow control: if … then
Flow control: try … then
the
Separators: Semicolon ";"semicolon is required.

These two lines are just Flow control: if … then
Flow control: try … then
the
same:

Instructions: var
How does VScript::Value() work?: Var*&
var
a = 0; Numeric functions: log
Numeric functions: loge
Instructions: log
log
a; a++; Numeric functions: log
Numeric functions: loge
Instructions: log
log
a; Instructions: var
How does VScript::Value() work?: Var*&
var
a = 0 Numeric functions: log
Numeric functions: loge
Instructions: log
log
a a++ log a

On Flow control: if … then
Flow control: try … then
the
other hand, these two lines differ!

Instructions: var
How does VScript::Value() work?: Var*&
var
a = 0; Numeric functions: log
Numeric functions: loge
Instructions: log
log
a; ++a; Numeric functions: log
Numeric functions: loge
Instructions: log
log
a; Instructions: var
How does VScript::Value() work?: Var*&
var
a = 0 Numeric functions: log
Numeric functions: loge
Instructions: log
log
a ++a Numeric functions: log
Numeric functions: loge
Instructions: log
log
a

Because Flow control: if … then
Flow control: try … then
the
parser Flow control: do … loopdoes Operators: Bitwise Not "~"
Operators: Boolean Negation "!"
not
know about Flow control: if … then
Flow control: try … then
the
"evident meaning" of spaces Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
and
thus sees:

Instructions: var
How does VScript::Value() work?: Var*&
var
a = 0 Numeric functions: log
Numeric functions: loge
Instructions: log
log
a++ a Numeric functions: log
Numeric functions: loge
Instructions: log
log
a

(which in List functions: thisthis example actually just wouldn't matter. idiotic example, i admit.)

Round brackets "( … )"

Separators: Round brackets "( … )"
Functions with varying return types: bracket expression "()"
Round brackets
override Operators: Operator precedenceoperator priority in Vipsi command syntax: Expressions
Glossary: Expression
expressions
Operators: Boolean Or with Variable "||="
Operators: Bitwise Or with Variable "|="
Operators: Bitwise Or "|"
Operators: Boolean Or "||"
or
enclose Vipsi command syntax: Arguments
Glossary: Arguments
argument
Data Types: Lists and arrays
Item selector "[]": Lists
Glossary: list, list_val
list
for Vipsi command syntax: Procedures
Data Types: Procedures
Glossary: Procedure
procedures
.

e.g.:

Override Operators: Operator precedenceoperator priority:

Instructions: putput 2*(3+4)

Enclose Vipsi command syntax: Arguments
Glossary: Arguments
argument
Data Types: Lists and arrays
Item selector "[]": Lists
Glossary: list, list_val
list
:

Instructions: putput Numeric functions: sinsin ( Constants: pipi/3 )
Instructions: putput median(34,56)

Example for both:

Instructions: procproc median(a,b) { Flow control: returnreturn (a+b)/2; }

Square brackets "[ … ]"

Separators: Square brackets "[ … ]"Square brackets enclose subrange Operators: Boolean Or with Variable "||="
Operators: Bitwise Or with Variable "|="
Operators: Bitwise Or "|"
Operators: Boolean Or "||"
or
Operators: Named Item Selector "."
Operators: Item selector "[]"
item selector
for Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
texts
Operators: Boolean Or with Variable "||="
Operators: Bitwise Or with Variable "|="
Operators: Bitwise Or "|"
Operators: Boolean Or "||"
or
Data Types: Lists and arrays
Item selector "[]": Lists
Glossary: list, list_val
lists
. Numeric functions: indexindexes start with 1.

e.g.:

Instructions: putput "abcde"[2 to 3]
Instructions: putput {1,2,3}[1]
Instructions: putput my_textlist[47, 3 to ]

Curly brackets "{ … }"

Separators: Curly brackets "{ … }"
Instructions: Local scope "{}"
Curly brackets
, Operators: Boolean Or with Variable "||="
Operators: Bitwise Or with Variable "|="
Operators: Bitwise Or "|"
Operators: Boolean Or "||"
or
Separators: Curly brackets "{ … }"
Instructions: Local scope "{}"
braces
, enclose Literals: List literals
Lists and arrays: List literals
list literals
, Vipsi command syntax: Procedures
Data Types: Procedures
Glossary: Procedure
procedure
bodies, Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
and
blocks of Vipsi command syntax: Instructions
Instructions
Glossary: Instruction
instructions
with a private Glossary: Variable, var_refvariable scope.

Literals: List literals
Lists and arrays: List literals
List literals
:

Instructions: var
How does VScript::Value() work?: Var*&
var
a = { 1, 2, 3 } Instructions: var
How does VScript::Value() work?: Var*&
var
b = { a, a, {1,2}, "abc", zz=Instructions: procproc(){Flow control: returnreturn 22;} }

Data Types: Lists and arrays
Item selector "[]": Lists
Glossary: list, list_val
List
b contains, among other items, again a Data Types: Lists and arrays
Item selector "[]": Lists
Glossary: list, list_val
list
{1,2} Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
and
a Vipsi command syntax: Procedures
Data Types: Procedures
Glossary: Procedure
procedure
named zz.

Vipsi command syntax: Procedures
Data Types: Procedures
Glossary: Procedure
Procedure
bodies:

Instructions: procproc hello() { Instructions: putput "hello ",List functions: env
Shell Immediate Commands: env
Shell Immediate Commands: env
env
.USER,"!" } Instructions: var
How does VScript::Value() work?: Var*&
var
u2 = Instructions: procproc() { Instructions: putput "hello vipsi!" }

Line 1 defines a produre Glossary: Variable, var_refvariable named hello, Flow control: whilewhile line 2 defines a Glossary: Variable, var_refvariable u2 which is immediately assigned an unnamed Literals: Procedure literals
Procedures: Procedure literals
procedure literal
, effectively doing something very similar to line 1. ;-)

Vipsi command syntax: Procedures
Data Types: Procedures
Glossary: Procedure
Procedures
can be defined inside other Vipsi command syntax: Procedures
Data Types: Procedures
Glossary: Procedure
procedures
.

Range of Vipsi command syntax: Instructions
Instructions
Glossary: Instruction
instructions
with a private Glossary: Variable, var_refvariable scope:

Instructions: var
How does VScript::Value() work?: Var*&
var
a = 22; { Instructions: var
How does VScript::Value() work?: Var*&
var
a=0; Flow control: do … loopdo; Flow control: whilewhile ++a<=10; Instructions: putput a," "; Flow control: do … looploop; } Instructions: putput a; // prints 22

Instructions: Local scope "{}"Local scopes can be nested.

Valid HTML   Valid CSS