Separators: Comma ","Commas separate Vipsi command syntax: Arguments Glossary: Argumentsarguments for Vipsi command syntax: Instructions Instructions Glossary: Instructioninstructions 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: Procedureprocedures, items in Literals: List literals Lists and arrays: List literalslist 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_vallists.
Separate Vipsi command syntax: Arguments Glossary: Argumentsarguments of Vipsi command syntax: Instructions Instructions Glossary: Instructioninstructions:
Instructions: putput "a=", a, Constants: nlnl;
Separate Vipsi command syntax: Arguments Glossary: Argumentsarguments of Vipsi command syntax: Functions Functions Glossary: Functionfunctions:
a = Numeric functions: maxmax( b,c );
Separate items in Literals: List literals Lists and arrays: List literalslist 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_vallists:
n = mylist[ i,j ];
n = mylist[i][j]; // just Flow control: if … then Flow control: try … thenthe same
Separate Numeric functions: indexindex in 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 Numeric functions: indexindex in Data Types: Text Item selector "[]": Text Glossary: text, text_valtext of Flow control: if … then Flow control: try … thenthe 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 … thenthe same
Instructions: putput a // prints: b
Flow control: if … then Flow control: try … thenThe Separators: Semicolon ";"semicolon ";" is used to separate Vipsi command syntax: Statements Glossary: Statementstatements. 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 … thenthe parser but improves readability of your source.
These following examples are just Flow control: if … then Flow control: try … thenthe 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, endexit Flow control: if … then Flow control: try … thenthen 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, endexit; Flow control: if … then Flow control: try … thenthen; 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, endexit Flow control: if … then Flow control: try … thenthen
i+=i
Flow control: do … looploop
Instructions: putput "i = ", i, Constants: nlnl
Actually sometimes Flow control: if … then Flow control: try … thenthe Separators: Semicolon ";"semicolon is required.
These two lines are just Flow control: if … then Flow control: try … thenthe same:
Instructions: var How does VScript::Value() work?: Var*&var a = 0; Numeric functions: log Numeric functions: loge Instructions: loglog a; a++; Numeric functions: log Numeric functions: loge Instructions: loglog a;
Instructions: var How does VScript::Value() work?: Var*&var a = 0 Numeric functions: log Numeric functions: loge Instructions: loglog a a++ Numeric functions: log Numeric functions: loge Instructions: loglog a
On Flow control: if … then Flow control: try … thenthe other hand, these two lines differ!
Instructions: var How does VScript::Value() work?: Var*&var a = 0; Numeric functions: log Numeric functions: loge Instructions: loglog a; ++a; Numeric functions: log Numeric functions: loge Instructions: loglog a;
Instructions: var How does VScript::Value() work?: Var*&var a = 0 Numeric functions: log Numeric functions: loge Instructions: loglog a ++a Numeric functions: log Numeric functions: loge Instructions: loglog a
Because Flow control: if … then Flow control: try … thenthe parser Flow control: do … loopdoes Operators: Bitwise Not "~" Operators: Boolean Negation "!"not know about Flow control: if … then Flow control: try … thenthe "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: loglog a++ a Numeric functions: log Numeric functions: loge Instructions: loglog a
(which in List functions: thisthis example actually just wouldn't matter. idiotic example, i admit.)
Separators: Round brackets "( … )" Functions with varying return types: bracket expression "()"Round brackets override Operators: Operator precedenceoperator priority in Vipsi command syntax: Expressions Glossary: Expressionexpressions Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or enclose Vipsi command syntax: Arguments Glossary: Argumentsargument Data Types: Lists and arrays Item selector "[]": Lists Glossary: list, list_vallist for Vipsi command syntax: Procedures Data Types: Procedures Glossary: Procedureprocedures.
e.g.:
Override Operators: Operator precedenceoperator priority:
Instructions: putput 2*(3+4)
Enclose Vipsi command syntax: Arguments Glossary: Argumentsargument Data Types: Lists and arrays Item selector "[]": Lists Glossary: list, list_vallist:
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; }
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_valtexts 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_vallists. 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 ]
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 literalslist literals, Vipsi command syntax: Procedures Data Types: Procedures Glossary: Procedureprocedure 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: Instructioninstructions with a private Glossary: Variable, var_refvariable scope.
Literals: List literals Lists and arrays: List literalsList 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_valList b contains, among other items, again a Data Types: Lists and arrays Item selector "[]": Lists Glossary: list, list_vallist {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: Procedureprocedure named zz.
Vipsi command syntax: Procedures Data Types: Procedures Glossary: ProcedureProcedure bodies:
Instructions: procproc hello() { Instructions: putput "hello ",List functions: env Shell Immediate Commands: env Shell Immediate Commands: envenv.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 literalsprocedure literal, effectively doing something very similar to line 1. ;-)
Vipsi command syntax: Procedures Data Types: Procedures Glossary: ProcedureProcedures can be defined inside other Vipsi command syntax: Procedures Data Types: Procedures Glossary: Procedureprocedures.
Range of Vipsi command syntax: Instructions Instructions Glossary: Instructioninstructions 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.
|