Flow control: if … then Flow control: try … thenThe vip Example Scripts: CGI Scripts Example Scripts: Scriptsscript language knows about 4 Data Types Invariants: Data typesdata types:
- Data Types: NumbersNumbers
- Data Types: Text
Item selector "[]": Text Glossary: text, text_valText
- Data Types: Lists and arrays
Item selector "[]": Lists Glossary: list, list_valLists / Data Types: Lists and arraysarrays
- Vipsi command syntax: Procedures
Data Types: Procedures Glossary: ProcedureProcedures
Sometimes Vipsi command syntax: Identifiers (names) Identifiers, names Operators: Make Identifier "@" Text functions: name Glossary: Name, Identifiernames itself may be considered as a 5Flow control: if … then Flow control: try … thenth Data Types Invariants: Data typesdata type.
Data Types: NumbersNumbers are stored internally in an 8-byte IEEE Number literals: Floating pointfloating point format (except Flow control: if … thenif List functions: thisthis format is Operators: Bitwise Not "~" Operators: Boolean Negation "!"not available) which allows for a precision of up to 53 bits including Numeric functions: signsign bit (approx. ±16 Number literals: Decimal Integer numbers: Decimal Floating point: Decimaldecimal digits) Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and an exponent of 11 bits (approx. ±308 Number literals: Decimal Integer numbers: Decimal Floating point: Decimaldecimal digits).
Support for 10-byte IEEE Data Types: Numbersnumbers as a compile-time option is planned (as of version 0.8.7), which will give you 64 bit accuracy.
Numeric functions: minmin./Numeric functions: maxmax. integer: ±((1<<53)-1)
= ±9.007199254741e+15
Numeric functions: minmin./Numeric functions: maxmax. Glossary: Valuevalues: ±(((1<<53)-1)<<52)<<1023
= ±1.7976931348623e+308
nearest Glossary: Valuevalues to null: ±1>>1022
(full precision) = ±2.2250738585072e-308
nearest Glossary: Valuevalues to null: ±(1>>52)>>1022
(denormalized) = ±4.9406564584125e-324
Besides that are some abnormal monstrosities like NaNs Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and signed zeros. I hope for your sake that you never need it. B-)
Literals: Number literals Numbers: Number literalsNumber literals can be written in multiple styles. All Literals: Number literals Numbers: Number literalsnumber literals can be preceded by a Glossary: number, num_valnumber Numeric functions: signsign '+' Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or '-'.
Literals: Number literals Numbers: Number literalsNumber literals with Integer numbers: Base 256base 10:
1234
-1234
+234567
Literals: Number literals Numbers: Number literalsNumber literals with Integer numbers: Base 256base 16 are introduced with a dollar Numeric functions: signsign '$':
$123affe
-$adf
+$adfeee
Literals: Number literals Numbers: Number literalsNumber literals with Integer numbers: Base 256base 2 are introduced with a percent Numeric functions: signsign '%':
%10100101
%1011010010101010101010101010100101
+%10100101
-%010111
Literals: Number literals Numbers: Number literalsNumber literal with 'character digits'. Each character represents a digit in range [0 .. 255]. Flow control: if … thenIf you Functions with varying return types: include Instructions: includeinclude characters with a character code greater than 255 Flow control: if … then Flow control: try … thenthen Flow control: if … then Flow control: try … thenthe character code is silently chopped.
'a'
'bee'
+'mixa'
-'AFFE'
'2A\'s' escaping a "'"
'\n' other escape codes are allowed too
'\x1e' see --> Escape characters
Number literals: Floating pointFloating point Glossary: number, num_valnumber can be written with a Number literals: Decimal Integer numbers: Decimal Floating point: Decimaldecimal, Integer numbers: Hexadecimal Floating point: Hexadecimal Text functions: hexstrhexadecimal Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and Integer numbers: Binary Floating point: Binary Text functions: binstrbinary Glossary: number, num_valnumber Integer numbers: Base 256base. Scientific notation (with exponent) is only supported for Number literals: Decimal Integer numbers: Decimal Floating point: Decimaldecimal Data Types: Numbersnumbers.
-123.456
0.456
123.456e78 scientific notation
+123.456e-78
.123 List functions: thisthis is Operators: Bitwise Not "~" Operators: Boolean Negation "!"not a Glossary: number, num_valnumber!
$0.FFFFFFFF
-$b00.b00f
+$afddb00.00d
%101000.00101
+%1010.0101
-%1010.010100
Data Types: Text Item selector "[]": Text Glossary: text, text_valText is stored internally in a format that allows for virtually any Data Types: Text Item selector "[]": Text Glossary: text, text_valtext dir: lengthlength Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and can store any unicode character (Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and beyond) including character code 0. There is no problem storing Integer numbers: Binary Floating point: Binary Text functions: binstrbinary daty in Data Types: Text Text functions: stringstrings. In fact, it is common practice to Instructions: readread whole Text functions: file Instructions: filefiles into a Data Types: Text Text functions: stringstring before starting work on Flow control: if … then Flow control: try … thenthem. ;-)
When reading Data Types: Text Item selector "[]": Text Glossary: text, text_valtext from a Text functions: file Instructions: filefile in Integer numbers: Binary Floating point: Binary Text functions: binstrbinary mode Flow control: if … then Flow control: try … thenthe resulting Data Types: Text Item selector "[]": Text Glossary: text, text_valtext consists only of characters with codes in range [0 .. 255]. You can Flow control: do … loopdo manual conversion with Text functions: convert Instructions: convertconvert Flow control: if … thenif required, mocrifying your Integer numbers: Binary Floating point: Binary Text functions: binstrbinary data into a real Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and unicode compliant Data Types: Text Item selector "[]": Text Glossary: text, text_valtext. When reading a Data Types: Text Item selector "[]": Text Glossary: text, text_valtext in Flow control: if … then Flow control: try … thenthe preferred way with Instructions: getget from an opened stream Flow control: if … then Flow control: try … thenthen you Instructions: getget Data Types: Text Item selector "[]": Text Glossary: text, text_valtext, Operators: Bitwise Not "~" Operators: Boolean Negation "!"not Integer numbers: Binary Floating point: Binary Text functions: binstrbinary data, Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and Flow control: if … then Flow control: try … thenthe conversion is already done for you. Flow control: if … then Flow control: try … thenThe default encoding is UTF-8. Writing to Text functions: file Instructions: filefiles Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and streams works similar - just reverse.
Literals: Text literals Text: Text literalsText literals are written 'as is' Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and enclosed in either of two types of Separatorsseparators:
"hello" a simple Data Types: Text Item selector "[]": Text Glossary: text, text_valtext
«say "hello"» a simple Data Types: Text Item selector "[]": Text Glossary: text, text_valtext which contains quotes
"List functions: thisthis is a longish Literals: Text literals Text: Text literalstext literal
which Functions with varying return types: include Instructions: includeincludes two line breaks.\n"
Instructions: var How does VScript::Value() work?: Var*&var myText = "List functions: thisthis is a long Literals: Text literals Text: Text literalstext literal \
which spans multiple lines \
but which Flow control: do … loopdoes Operators: Bitwise Not "~" Operators: Boolean Negation "!"not Functions with varying return types: include Instructions: includeinclude Flow control: if … then Flow control: try … thenthe line breaks \
Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and indentation characters."
Literals: Text literals Text: Text literalsText literals can enclose any character, including line breaks, but except Flow control: if … then Flow control: try … thenthe closing Separatorsseparator. Some control codes may be hard too. B-)
Control codes Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and characters with special meaning, that is, Flow control: if … then Flow control: try … thenthe Text literals: Escape characterescape character Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and Flow control: if … then Flow control: try … thenthe closing Separatorsseparator, Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and most other characters too can be escaped using c- Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and bash-style character escaping Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and encoding introduced with Flow control: if … then Flow control: try … thenthe backslash '\' character:
\\ escapes Flow control: if … then Flow control: try … thenthe Text literals: Escape characterescape character
\" escapes Flow control: if … then Flow control: try … thenthe closing Separatorsseparator in ".." Data Types: Text Text functions: stringstrings
\» escapes Flow control: if … then Flow control: try … thenthe closing Separatorsseparator in «..» Data Types: Text Text functions: stringstrings
\123 circumscribes a character with octal notation
character code range: [0 .. 255]
\x1a circumscribes a character with Integer numbers: Hexadecimal Floating point: Hexadecimal Text functions: hexstrhexadecimal notation
character code range: [0 .. 255]
\cX circumscribes a control character by applying a bit mask
character code range: [0 .. 31]
\n circumscribes a character with it's 'well known Vipsi command syntax: Identifiers (names) Identifiers, names Operators: Make Identifier "@" Text functions: name Glossary: Name, Identifiername'
List functions: thisthis is Flow control: if … then Flow control: try … thenthe Data Types: Lists and arrays Item selector "[]": Lists Glossary: list, list_vallist:
\e \a \b \f \n \r \t \v
$1B $07 $08 $0C $0A $0D $09 $0B
\ Operators: Make Identifier "@"at Flow control: end Shell Immediate Commands: exit, quit, endend of line: discards Flow control: if … then Flow control: try … thenthe line break Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and all white space
up to Flow control: if … then Flow control: try … thenthe first printable character. Used to break up Data Types: Text Item selector "[]": Text Glossary: text, text_valtext
in Literals: Text literals Text: Text literalstext literals for readability.
A "\" backslash before any other character without special meaning is simply discarded.
Individual characters Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and substrings are accessed with either Text functions: leftstrleftstr() Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and Flow control: if … then Flow control: try … thenthe like Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or an array-like notation:
Instructions: putput "Anton"[3] // prints: t
Instructions: putput "Anton Bruckner"[3 to 5] // prints: ton
Instructions: putput "Caesar Cicero"[to 5] // prints: Caesar
Instructions: putput "Caesar Cicero"[8 to] // prints: Cicero
Instructions: putput "Casiopeia"[ to ] // prints: Casiopeia
Numeric functions: indexIndexes start Operators: Make Identifier "@"at 1, ranges are declared with Flow control: if … then Flow control: try … thenthe first Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and last Numeric functions: indexindex inclusive.
Data Types: Lists and arrays Item selector "[]": Lists Glossary: list, list_valLists may be of any size Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and nested to any level Flow control: untiluntil you run out of RAM.
Data Types: Lists and arrays Item selector "[]": Lists Glossary: list, list_valLists can be initialized with { ... } in one go, including nested sub-lists Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and naming of Data Types: Lists and arrays Item selector "[]": Lists Glossary: list, list_vallist items.
{ } an empty Data Types: Lists and arrays Item selector "[]": Lists Glossary: list, list_vallist
{ 1, 2, 3 } a Data Types: Lists and arrays Item selector "[]": Lists Glossary: list, list_vallist with three items
{ "a", "b", 44 } again three items
{ 1, {"a","b"} } two items. Flow control: if … then Flow control: try … thenthe second item itself is a Data Types: Lists and arrays Item selector "[]": Lists Glossary: list, list_vallist
{ x=22, y=1.5, z=0 } items may by named
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 literalslist literals. List functions: thisThis depends on Flow control: if … then Flow control: try … thenthe 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 … thenthe place of an Vipsi command syntax: Instructions Instructions Glossary: Instructioninstruction Flow control: if … then Flow control: try … thenthen 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 … thenthe position of an Vipsi command syntax: Expressions Glossary: Expressionexpression Flow control: if … then Flow control: try … thenthen it is Flow control: if … then Flow control: try … thenthe beginning of a Literals: List literals Lists and arrays: List literalslist literal.
Flow control: if … then Flow control: try … thenThe only place where List functions: thisthis may lead to confusion is Flow control: if … then Flow control: try … thenthe vipsi shell: Operators: Make Identifier "@"At Flow control: if … then Flow control: try … thenthe start of Flow control: if … then Flow control: try … thenthe command line Flow control: if … then Flow control: try … thenthe parser expects an Vipsi command syntax: Instructions Instructions Glossary: Instructioninstruction. For your convenience it is also possible to just type an Vipsi command syntax: Expressions Glossary: Expressionexpression Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and Flow control: if … then Flow control: try … thenthe shell will print Flow control: if … then Flow control: try … thenthe 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 literalslist literal as expected, Flow control: if … then Flow control: try … thenthen Flow control: if … then Flow control: try … thenthe opening { stands Operators: Make Identifier "@"at Flow control: if … then Flow control: try … thenthe position of an Vipsi command syntax: Instructions Instructions Glossary: Instructioninstruction 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 … thenthe start of a range of Vipsi command syntax: Statements Glossary: Statementstatements with private Glossary: Variable, var_refvariable scope.
As of version 0.8.8 Flow control: if … then Flow control: try … thenthe shell has some automagic intelligence to detect List functions: thisthis. Flow control: if … thenIf a command line starts with an opening Separators: Curly brackets "{ … }" Instructions: Local scope "{}"brace { Flow control: if … then Flow control: try … thenthen Flow control: if … then Flow control: try … thenthe shell defaults to a Literals: List literals Lists and arrays: List literalslist 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: Instructioninstruction 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: Statementstatement in front of Flow control: if … then Flow control: try … thenthe Data Types: Lists and arrays Item selector "[]": Lists Glossary: list, list_vallist Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and Flow control: if … then Flow control: try … thenthe 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: Expressionexpression without glue.
Individual items Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and substrings are accessed either by Vipsi command syntax: Identifiers (names) Identifiers, names Operators: Make Identifier "@" Text functions: name Glossary: Name, Identifiername Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or with an array-like notation:
Numeric functions: indexIndexes start Operators: Make Identifier "@"at 1, ranges are declared with Flow control: if … then Flow control: try … thenthe first Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and last Numeric functions: indexindex inclusive.
Accessing an item beyond Flow control: if … then Flow control: try … thenthe Flow control: end Shell Immediate Commands: exit, quit, endend of a Data Types: Lists and arrays Item selector "[]": Lists Glossary: list, list_vallist automatically creates all intermediate items, which are unnamed Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and set to Glossary: number, num_valnumber Glossary: Valuevalue 0.0.
Instructions: var How does VScript::Value() work?: Var*&var my_list = { 1, 2, 3, a=4, b=5, c=6 }
Instructions: putput my_list.a // prints: 4
Instructions: putput my_list[3] // prints: 3
Instructions: putput my_list[3 to 5] // prints: { 3, a=4, b=5 }
Instructions: putput my_list[to 4] // prints: { 1, 2, 3, a=4 }
Instructions: putput my_list[5 to] // prints: { b=5, c=6 }
Instructions: putput my_list[ to ] // prints: { 1, 2, 3, a=4, b=5, c=6 }
Instructions: var How does VScript::Value() work?: Var*&var list2 = { 1, z={ 2, z="Anton", 3}, 4 }
Instructions: putput list2.z // prints: { 2, z="Anton", 3 }
Instructions: putput list2.z.z // prints: Anton
Instructions: putput list2[2,2,to 3] // prints: Ant
Instructions: putput list2.z[2,to 3] // prints: Ant
Instructions: var How does VScript::Value() work?: Var*&var list3={} // create empty Data Types: Lists and arrays Item selector "[]": Lists Glossary: list, list_vallist
list3[100] // resize Data Types: Lists and arrays Item selector "[]": Lists Glossary: list, list_vallist to 100 elements
Instructions: var How does VScript::Value() work?: Var*&var i = Numeric functions: intint(Numeric functions: randomrandom(2)) +1
Instructions: putput { "foo", "bär" }[i]
Vipsi command syntax: Procedures Data Types: Procedures Glossary: ProcedureProcedures are a Data Types Invariants: Data typesdata type. Once defined, they can be executed, disassembled, passed to other Vipsi command syntax: Procedures Data Types: Procedures Glossary: Procedureprocedures as Vipsi command syntax: Arguments Glossary: Argumentsargument Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or Instructions: putput into a Data Types: Lists and arrays Item selector "[]": Lists Glossary: list, list_vallist.
Vipsi command syntax: Procedures Data Types: Procedures Glossary: ProcedureProcedures can be called recursively.
Vipsi command syntax: Procedures Data Types: Procedures Glossary: ProcedureProcedures in a Data Types: Lists and arrays Item selector "[]": Lists Glossary: list, list_vallist can access 'neighbour' data elements by Vipsi command syntax: Identifiers (names) Identifiers, names Operators: Make Identifier "@" Text functions: name Glossary: Name, Identifiername, thus supplying a light-weight approach for object oriented programming.
Vipsi command syntax: Procedures Data Types: Procedures Glossary: ProcedureProcedures can either take a fixed Glossary: number, num_valnumber of Vipsi command syntax: Arguments Glossary: Argumentsarguments Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or a Glossary: Variable, var_refvariable amount, indicated with an asterics *.
They can Flow control: returnreturn a result of any Data Types Invariants: Data typesdata type (Glossary: number, num_valnumber, Data Types: Text Item selector "[]": Text Glossary: text, text_valtext, Data Types: Lists and arrays Item selector "[]": Lists Glossary: list, list_vallist Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or a Vipsi command syntax: Procedures Data Types: Procedures Glossary: Procedureprocedure) Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or no result. Flow control: if … then Flow control: try … thenThe result they Flow control: returnreturn may vary depending on Flow control: if … then Flow control: try … thenthe Vipsi command syntax: Arguments Glossary: Argumentsargument data Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or other criteria.
Vipsi command syntax: Procedures Data Types: Procedures Glossary: ProcedureProcedures may be defined locally inside other Vipsi command syntax: Procedures Data Types: Procedures Glossary: Procedureprocedures. Because they can access 'neighbour' data items, they can access Flow control: if … then Flow control: try … thenthe List functions: localslocal data of Flow control: if … then Flow control: try … thenthe enclosing Vipsi command syntax: Procedures Data Types: Procedures Glossary: Procedureprocedure.
Literals: Procedure literals Procedures: Procedure literalsProcedure literals start with Flow control: if … then Flow control: try … thenthe keyword Instructions: procproc, followed by Separators: Round brackets "( … )" Functions with varying return types: bracket expression "()"parenthesis surrounding Flow control: if … then Flow control: try … thenthe Vipsi command syntax: Arguments Glossary: Argumentsarguments Data Types: Lists and arrays Item selector "[]": Lists Glossary: list, list_vallist Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and Separators: Curly brackets "{ … }" Instructions: Local scope "{}"braces surrounding Flow control: if … then Flow control: try … thenthe Vipsi command syntax: Statements Glossary: Statementstatements to execute.
<procedure> = Instructions: procproc ( <arguments> ) { <statements> }
Flow control: if … then Flow control: try … thenThe more common way to define a Vipsi command syntax: Procedures Data Types: Procedures Glossary: Procedureprocedure is with Flow control: if … then Flow control: try … thenthe Vipsi command syntax: Instructions Instructions Glossary: Instructioninstruction Instructions: procproc.
Vipsi command syntax: Instructions Instructions Glossary: InstructionInstruction 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 stores Flow control: if … then Flow control: try … thenthe Vipsi command syntax: Procedures Data Types: Procedures Glossary: Procedureprocedure in one go. Flow control: if … then Flow control: try … thenThe Vipsi command syntax: Procedures Data Types: Procedures Glossary: Procedureprocedure itself is written in a form very similar to that of a Literals: Procedure literals Procedures: Procedure literalsprocedure literal. Vipsi command syntax: Instructions Instructions Glossary: InstructionInstruction Instructions: procproc is a short form for creating a Glossary: Variable, var_refvariable as with Vipsi command syntax: Instructions Instructions Glossary: Instructioninstruction 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 literalsprocedure literal as initial Glossary: Valuevalue. Operators: Bitwise Not "~" Operators: Boolean Negation "!"Note Flow control: if … then Flow control: try … thenthe difference:
Vipsi command syntax: Instructions Instructions Glossary: InstructionInstruction Instructions: procproc:
Instructions: procproc <name> ( <arguments> ) { <statements> }
Vipsi command syntax: Instructions Instructions Glossary: InstructionInstruction Instructions: var How does VScript::Value() work?: Var*&var with Literals: Procedure literals Procedures: Procedure literalsprocedure literal as initial Glossary: Valuevalue:
Instructions: var How does VScript::Value() work?: Var*&var <name> = Instructions: procproc ( <arguments> ) { <statements> }
Using a real Literals: Procedure literals Procedures: Procedure literalsprocedure literal is sometimes convenient Flow control: if … thenif you want to Instructions: putput it in a Data Types: Lists and arrays Item selector "[]": Lists Glossary: list, list_vallist Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or Flow control: if … thenif you want to pass it to another Vipsi command syntax: Procedures Data Types: Procedures Glossary: Procedureprocedure as an Vipsi command syntax: Arguments Glossary: Argumentsargument.
When you Text functions: convert Instructions: convertconvert a Vipsi command syntax: Procedures Data Types: Procedures Glossary: Procedureprocedure 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_vallist containing a Vipsi command syntax: Procedures Data Types: Procedures Glossary: Procedureprocedure to a Data Types: Text Text functions: stringstring, which is implicitely done when you print it using Instructions: putput, it is reverted to it's Vipsi command syntax: Literals Glossary: Literalliteral appearance.
Store Literals: Procedure literals Procedures: Procedure literalsprocedure literal in a Glossary: Variable, var_refvariable:
Instructions: var How does VScript::Value() work?: Var*&var foo = Instructions: procproc(bär) { Flow control: returnreturn bär }
Instructions: var How does VScript::Value() work?: Var*&var z = Instructions: procproc() { Instructions: putput "hi" }
Store Vipsi command syntax: Procedures Data Types: Procedures Glossary: Procedureprocedure somewhere into a Data Types: Lists and arrays Item selector "[]": Lists Glossary: list, list_vallist:
Instructions: var How does VScript::Value() work?: Var*&var mylist = {}
mylist[100] = Instructions: procproc() { Instructions: putput "foobär" }
Instructions: putput mylist[100] // print item 100. prints disassembly
mylist[100]() // execute Flow control: if … then Flow control: try … thenthe Instructions: procproc. prints foobär
A Literals: Procedure literals Procedures: Procedure literalsprocedure literal as part of a Literals: List literals Lists and arrays: List literalslist literal:
Instructions: var How does VScript::Value() work?: Var*&var mylist = { 22, 33, z=Instructions: procproc(){Flow control: returnreturn List functions: thisthis[1]+List functions: thisthis[2]} }
Instructions: putput mylist.z // prints Flow control: if … then Flow control: try … thenthe Instructions: procproc: disassembly
Instructions: putput mylist.z() // prints Shell Scripts: Return values Appendix: Return valuesreturn value of Instructions: procproc: 55
A Literals: Procedure literals Procedures: Procedure literalsprocedure literal as Vipsi command syntax: Arguments Glossary: Argumentsargument to another Vipsi command syntax: Procedures Data Types: Procedures Glossary: Procedureprocedure:
SetMyFooIterator ( Instructions: procproc(i){Flow control: returnreturn i+1} );
But in most cases you would first define a Vipsi command syntax: Procedures Data Types: Procedures Glossary: Procedureprocedure Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and Flow control: if … then Flow control: try … thenthen pass List functions: thisthis Glossary: Variable, var_refvariable as an Vipsi command syntax: Arguments Glossary: Argumentsargument, because Vipsi command syntax: Procedures Data Types: Procedures Glossary: Procedureprocedures tend to be a little bit longish. ;-)
|