vipsi - the friendly vip script interpreter

Instructions

proc

Instructions: procproc <name> ( <arguments> ) { <statements> }

Create a Vipsi command syntax: Procedures
Data Types: Procedures
Glossary: Procedure
procedure
.

Flow control: if … then
Flow control: try … then
The
Vipsi command syntax: Instructions
Instructions
Glossary: Instruction
instruction
Instructions: procproc creates a Glossary: Variable, var_refvariable Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
and
Operators: Assignment "="assigns it a Vipsi command syntax: Procedures
Data Types: Procedures
Glossary: Procedure
procedure
as it's Glossary: Valuevalue. Flow control: if … then
Flow control: try … then
The
Vipsi command syntax: Procedures
Data Types: Procedures
Glossary: Procedure
procedure
itself is written in a form very similar to that of a Literals: Procedure literals
Procedures: Procedure literals
procedure literal
.

<arguments> denotes a Data Types: Lists and arrays
Item selector "[]": Lists
Glossary: list, list_val
list
of Vipsi command syntax: Arguments
Glossary: Arguments
argument
Vipsi command syntax: Identifiers (names)
Identifiers, names
Operators: Make Identifier "@"
Text functions: name
Glossary: Name, Identifier
names
. It may be empty, consist of one Vipsi command syntax: Identifiers (names)
Identifiers, names
Operators: Make Identifier "@"
Text functions: name
Glossary: Name, Identifier
name
, Operators: Boolean Or with Variable "||="
Operators: Bitwise Or with Variable "|="
Operators: Bitwise Or "|"
Operators: Boolean Or "||"
or
a Data Types: Lists and arrays
Item selector "[]": Lists
Glossary: list, list_val
list
of Vipsi command syntax: Identifiers (names)
Identifiers, names
Operators: Make Identifier "@"
Text functions: name
Glossary: Name, Identifier
names
separated by Separators: Comma ","commas. Flow control: if … then
Flow control: try … then
The
last item in Flow control: if … then
Flow control: try … then
the
Vipsi command syntax: Arguments
Glossary: Arguments
arguments
Data Types: Lists and arrays
Item selector "[]": Lists
Glossary: list, list_val
list
may be Flow control: if … then
Flow control: try … then
the
special character *, which indicates that an unknown amount of further Vipsi command syntax: Arguments
Glossary: Arguments
arguments
may be passed to Flow control: if … then
Flow control: try … then
the
Vipsi command syntax: Procedures
Data Types: Procedures
Glossary: Procedure
procedure
. These are stored in unnamed List functions: localslocal Glossary: Variable, var_refvariables, which can be accessed using List functions: localslocals[<index>].

<statements> are Flow control: if … then
Flow control: try … then
the
Vipsi command syntax: Statements
Glossary: Statement
statements
which are executed when Flow control: if … then
Flow control: try … then
the
Vipsi command syntax: Procedures
Data Types: Procedures
Glossary: Procedure
procedure
is called.

Actually Vipsi command syntax: Instructions
Instructions
Glossary: Instruction
instruction
Instructions: procproc is a short form for creating a Glossary: Variable, var_refvariable with Vipsi command syntax: Instructions
Instructions
Glossary: Instruction
instruction
Instructions: var
How does VScript::Value() work?: Var*&
var
Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
and
assigning it a Literals: Procedure literals
Procedures: Procedure literals
procedure literal
as initial Glossary: Valuevalue. Operators: Bitwise Not "~"
Operators: Boolean Negation "!"
Note
Flow control: if … then
Flow control: try … then
the
difference:

Vipsi command syntax: Instructions
Instructions
Glossary: Instruction
Instruction
Instructions: procproc:

Instructions: procproc <name> ( <arguments> ) { <statements> }

Vipsi command syntax: Instructions
Instructions
Glossary: Instruction
Instruction
Instructions: var
How does VScript::Value() work?: Var*&
var
with Literals: Procedure literals
Procedures: Procedure literals
procedure literal
as initial Glossary: Valuevalue:

Instructions: var
How does VScript::Value() work?: Var*&
var
<name> = Instructions: procproc ( <arguments> ) { <statements> }

e.g.:

Instructions: procproc foo(bär) { Flow control: returnreturn bär }
Instructions: var
How does VScript::Value() work?: Var*&
var
foo = Instructions: procproc(bär) { Flow control: returnreturn bär }

See --> Literals: Procedure literals
Procedures: Procedure literals
Procedure literals
for more details on Literals: Procedure literals
Procedures: Procedure literals
procedure literals
. (sic!)

Examples

Instructions: procproc foo()  { }
Instructions: procproc bee(a) { Instructions: putput a }
Instructions: procproc x(a,b) { Flow control: returnreturn a+b }
Instructions: procproc foo.bar() { }

Instructions: procproc fak(n) { Flow control: if … thenif n<=1 Flow control: returnreturn 1; Flow control: if … then
Flow control: try … then
else
Flow control: returnreturn n*fak(n-1); Flow control: if … then
Flow control: try … then
then
} Instructions: putput fak(77) Instructions: procproc foo(a) { put a } // define Vipsi command syntax: Procedures
Data Types: Procedures
Glossary: Procedure
procedure
foo foo(123) // Functions with varying return types: call
Instructions: call
call
foo; prints Flow control: if … then
Flow control: try … then
the
Glossary: number, num_valnumber: 123 foo("abc") // Functions with varying return types: call
Instructions: call
call
foo; prints Flow control: if … then
Flow control: try … then
the
Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
text
: abc Instructions: putput foo // Instructions: putput prints foo: disassembly Instructions: procproc Operators: Add to Variable "+="
Operators: Add "+"
add
( * ) { Instructions: var
How does VScript::Value() work?: Var*&
var
i = Numeric functions: countcount(List functions: localslocals) // Operators: Bitwise Not "~"
Operators: Boolean Negation "!"
note
: Numeric functions: countcount(List functions: localslocals) Functions with varying return types: include
Instructions: include
includes
+1 for Instructions: var
How does VScript::Value() work?: Var*&
var
i itself! Instructions: var
How does VScript::Value() work?: Var*&
var
result = 0 Flow control: do … loopdo Flow control: whilewhile --i result += List functions: localslocals[i] Flow control: do … looploop Flow control: returnreturn result }

Valid HTML   Valid CSS