Vipsi command syntax: Functions Functions Glossary: FunctionFunctions which Flow control: returnreturn Glossary: text, text_valtext values.
<text> = Text functions: binstrbinstr ( <number> )
<text> = Text functions: binstrbinstr ( <number>, <digits> )
Text functions: convert Instructions: convertConvert integer Glossary: number, num_valnumber to Integer numbers: Binary Floating point: Binary Text functions: binstrbinary Vipsi command syntax: Literals Glossary: Literalliteral representation.
Text functions: convert Instructions: convertConvert <number> to a Integer numbers: Binary Floating point: Binary Text functions: binstrbinary digit Data Types: Text Text functions: stringstring. Resulting <text> is sized to fit Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or sized according to <digits>, which must be a numeric Glossary: Valuevalue, truncating Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or padding with '0's Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or '1's to Flow control: if … then Flow control: try … thenthe left.
Positive Glossary: Valuevalues are padded with '0's to Flow control: if … then Flow control: try … thenthe left, negative Glossary: Valuevalues are printed as their -1-Operators: Bitwise Not "~"complement, as is common for Number literals: Integer numbersinteger numbers, Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and padded with '1's to Flow control: if … then Flow control: try … thenthe left. Flow control: if … thenIf no <digits> are given, Flow control: if … then Flow control: try … thenthen negative Glossary: Valuevalues are always printed with Flow control: if … then Flow control: try … thenthe most significant bit set, e.g. they always start with digit '1'.
e.g.:
vipsi> Text functions: binstrbinstr(10) 1010
vipsi> Text functions: binstrbinstr(10,8) 00001010
vipsi> Text functions: binstrbinstr(10,1) 0
vipsi> Text functions: binstrbinstr(-10,4) 0110
vipsi> Text functions: binstrbinstr(-10,8) 11110110
vipsi> Text functions: binstrbinstr(-10) 10110
vipsi> Text functions: binstrbinstr(1e10) 1001010100000010111110010000000000
vipsi>
<text> = Text functions: charstrcharstr <number>
<text> = Text functions: charstrcharstr ( <number> )
Text functions: convert Instructions: convertconvert <number> to <text>. <number> is a unicode character code 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 returned <text> is a Data Types: Text Text functions: stringstring containing that character.
As with all Vipsi command syntax: Functions Functions Glossary: Functionfunctions which take exactly one Vipsi command syntax: Arguments Glossary: Argumentsargument, Flow control: if … then Flow control: try … thenthe Separators: Round brackets "( … )" Functions with varying return types: bracket expression "()"parenthesis may be omitted, Flow control: if … then Flow control: if … thenif the Vipsi command syntax: Arguments Glossary: Argumentsargument 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: Expressionexpression with Vipsi command syntax: Operators Operators Glossary: Operatoroperators.
e.g.:
Text functions: charstrcharstr 8364 = "€"
<text> = Text functions: convert Instructions: convertconvert ( <text> to|from <encoding> )
Text functions: convert Instructions: convertConvert Data Types: Text Item selector "[]": Text Glossary: text, text_valtext from Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or to named encoding.
Flow control: if … then Flow control: try … thenThe <encoding> must be a Vipsi command syntax: Identifiers (names) Identifiers, names Operators: Make Identifier "@" Text functions: name Glossary: Name, Identifiername, Operators: Bitwise Not "~" Operators: Boolean Negation "!"not a Glossary: text, text_valtext value. That means: just Instructions: writewrite Flow control: if … then Flow control: try … thenthe nickname here. Flow control: if … then Flow control: try … thenThe converted Data Types: Text Item selector "[]": Text Glossary: text, text_valtext is returned as result.
e.g.:
mytext = Text functions: convert Instructions: convertconvert( mytext to printable );
mytext = Text functions: convert Instructions: convertconvert( mytext to mac_roman );
mytext = Text functions: convert Instructions: convertconvert( mytext from html );
Instructions: putput "http://", Text functions: convert Instructions: convertconvert(mytext to url)
Flow control: if … thenIf you need calculated encodings, you may use Vipsi command syntax: Operators Operators Glossary: Operatoroperator @ to Text functions: convert Instructions: convertconvert a Data Types: Text Item selector "[]": Text Glossary: text, text_valtext to a Vipsi command syntax: Identifiers (names) Identifiers, names Operators: Make Identifier "@" Text functions: name Glossary: Name, Identifiername:
Instructions: var How does VScript::Value() work?: Var*&var myEncoding = "tab4"
myText = Text functions: convert Instructions: convertconvert( myText to @(myEncoding) );
Take care that you Flow control: do … loopdo no double conversion!
Converting to a certain character set Text functions: convert Instructions: convertconverts Flow control: if … then Flow control: try … thenthe Data Types: Text Item selector "[]": Text Glossary: text, text_valtext to Integer numbers: Binary Floating point: Binary Text functions: binstrbinary data with all characters being bytes in range [0 .. 255], suitable for writing to Text functions: file Instructions: filefile Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or stream in Integer numbers: Binary Floating point: Binary Text functions: binstrbinary mode.
Converting from a certain character set expects Flow control: if … then Flow control: try … thenthe Data Types: Text Item selector "[]": Text Glossary: text, text_valtext to be Integer numbers: Binary Floating point: Binary Text functions: binstrbinary data with all characters being bytes in range [0 .. 255], as Instructions: readread in Integer numbers: Binary Floating point: Binary Text functions: binstrbinary mode from a Text functions: file Instructions: filefile Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or stream.
Converting a Data Types: Text Item selector "[]": Text Glossary: text, text_valtext to a certain character set an Flow control: if … then Flow control: try … thenthen writing it with Instructions: putput to a Text functions: file Instructions: filefile Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or stream, is certainly an error, because Instructions: putput most likely also performs a convert: Character set conversions: convert: Character set conversions:character set conversion, by default to UTF-8. After having converted a character set by hand you must Instructions: writewrite Flow control: if … then Flow control: try … thenthe data in Integer numbers: Binary Floating point: Binary Text functions: binstrbinary mode, without any further conversion, e.g. with Vipsi command syntax: Instructions Instructions Glossary: Instructioninstruction Instructions: writewrite Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or using Vipsi command syntax: Instructions Instructions Glossary: Instructioninstruction Text functions: file Instructions: filefile.
Flow control: if … then Flow control: try … thenThe same is true for reading with Instructions: getget Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and converting Flow control: if … then Flow control: try … thenthe Instructions: readread Data Types: Text Item selector "[]": Text Glossary: text, text_valtext from a certain character set, because Instructions: getget has most likely already performed a convert: Character set conversions: convert: Character set conversions:character set conversion, by default from UTF-8. Flow control: if … thenIf you want to Text functions: convert Instructions: convertconvert Flow control: if … then Flow control: try … thenthe data by hand you must Instructions: readread it in Integer numbers: Binary Floating point: Binary Text functions: binstrbinary mode, e.g. with Vipsi command syntax: Instructions Instructions Glossary: Instructioninstruction Instructions: readread Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or Vipsi command syntax: Functions Functions Glossary: Functionfunction Text functions: file Instructions: filefile.
e.g. UCS-4:
Converting Data Types: Text Item selector "[]": Text Glossary: text, text_valtext to UCS-4 expands each character to 4 characters, each representable in 1 byte, suitable for writing in Integer numbers: Binary Floating point: Binary Text functions: binstrbinary mode to a Text functions: file Instructions: filefile e.g. with Instructions: writewrite.
Converting Data Types: Text Item selector "[]": Text Glossary: text, text_valtext from UCS-4 combines every 4 characters into one character, assuming that Flow control: if … then Flow control: try … thenthe source Data Types: Text Item selector "[]": Text Glossary: text, text_valtext only contains bytes e.g. Instructions: readread in Integer numbers: Binary Floating point: Binary Text functions: binstrbinary mode with Instructions: readread.
Instructions: var How does VScript::Value() work?: Var*&var a = Text functions: file Instructions: filefile "filename" Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and Text functions: file Instructions: filefile "filename" = a also Instructions: readread/Instructions: writewrite 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 are suitable targets for a by-hand conversion.
Instructions: getget Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or Instructions: putput already perform a conversion from|to UTF-8 (may be changed with Functions with varying return types: ioctl Instructions: ioctlioctl - Operators: Bitwise Not "~" Operators: Boolean Negation "!"not yet implemented in version 0.8.7). Applying a conversion after reading with Instructions: getget / before writing with Instructions: putput without having disabled any conversion is certainly an error.
<text> = Text functions: datestrdatestr ( <number> )
<text> = Text functions: datestrdatestr <number>
Text functions: convert Instructions: convertConverts numeric date format to readable <text>. Flow control: if … then Flow control: try … thenThe reverse Vipsi command syntax: Functions Functions Glossary: Functionfunction is Numeric functions: datevaldateval. Flow control: if … then Flow control: try … thenThe numeric date is expected to be in Greenwich mean time UTC+0:00.
As with all Vipsi command syntax: Functions Functions Glossary: Functionfunctions which take exactly one Vipsi command syntax: Arguments Glossary: Argumentsargument, Flow control: if … then Flow control: try … thenthe Separators: Round brackets "( … )" Functions with varying return types: bracket expression "()"parenthesis may be omitted, Flow control: if … then Flow control: if … thenif the Vipsi command syntax: Arguments Glossary: Argumentsargument 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: Expressionexpression with Vipsi command syntax: Operators Operators Glossary: Operatoroperators.
Operators: Bitwise Not "~" Operators: Boolean Negation "!"Note: applying of List functions: localslocal time zone Operators: Bitwise Not "~" Operators: Boolean Negation "!"not yet implemented. Actually Numeric functions: nownow Flow control: returnreturns List functions: localslocal time too, so List functions: thisthis is Operators: Make Identifier "@"at least consistent.
e.g.:
Text functions: datestrdatestr 0 = "1970-01-01 01:00:00"
<text> = Text functions: file Instructions: filefile <filename>
<text> = Text functions: file Instructions: filefile ( <filename> )
Instructions: readRead Text functions: file Instructions: filefile.
Instructions: readRead Text functions: file Instructions: filefile <filename> in Integer numbers: Binary Floating point: Binary Text functions: binstrbinary mode. Flow control: returnReturns a <text> Glossary: Valuevalue. All character codes are in range 0 ... 255. You should Text functions: convert Instructions: convertconvert character encoding afterwards manually with Flow control: if … then Flow control: try … thenthe Vipsi command syntax: Functions Functions Glossary: Functionfunction Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or Vipsi command syntax: Instructions Instructions Glossary: Instructioninstruction Text functions: convert Instructions: convertconvert, most likely from utf8.
As with all Vipsi command syntax: Functions Functions Glossary: Functionfunctions which take exactly one Vipsi command syntax: Arguments Glossary: Argumentsargument, Flow control: if … then Flow control: try … thenthe Separators: Round brackets "( … )" Functions with varying return types: bracket expression "()"parenthesis may be omitted, Flow control: if … then Flow control: if … thenif the Vipsi command syntax: Arguments Glossary: Argumentsargument 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: Expressionexpression with Vipsi command syntax: Operators Operators Glossary: Operatoroperators.
There is also an Vipsi command syntax: Instructions Instructions Glossary: Instructioninstruction Text functions: file Instructions: filefile which Instructions: writewrites to a Text functions: file Instructions: filefile.
e.g.
Instructions: var How does VScript::Value() work?: Var*&var myText = Text functions: file Instructions: filefile "~/.myPrefs/rcData"
Text functions: convert Instructions: convertconvert myText from utf8
...
Text functions: convert Instructions: convertconvert myText to utf8
Text functions: file Instructions: filefile "~/.myPrefs/rcData" = myText
<text> = Text functions: fullpathfullpath ( <text> )
<text> = Text functions: fullpathfullpath <text>
Instructions: getGet fully resolved, absolute path for partial path. Expands "./" Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and "../", symbolic Text functions: link Instructions: linklinks, "~" Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and relative path to Flow control: if … then Flow control: try … thenthe absolute Text functions: file Instructions: filefile Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or directory path.
Flow control: if … then Flow control: try … thenThe path must actually Numeric functions: existsexist, Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or List functions: thisthis Vipsi command syntax: Functions Functions Glossary: Functionfunction throws an error, which may be catched with Flow control: try … thentry. Only Flow control: if … then Flow control: try … thenthe last path component is allowed to be non-existent, which for instance may be a Operators: Multiply "*"wildcard pattern.
Flow control: if … then Flow control: if … thenIf the fully dereferenced path refers to a directory, Flow control: if … then Flow control: try … thenthen Flow control: if … then Flow control: try … thenthe returned path always Flow control: end Shell Immediate Commands: exit, quit, endends with a trailing slash "/".
As with all Vipsi command syntax: Functions Functions Glossary: Functionfunctions which take exactly one Vipsi command syntax: Arguments Glossary: Argumentsargument, Flow control: if … then Flow control: try … thenthe Separators: Round brackets "( … )" Functions with varying return types: bracket expression "()"parenthesis may be omitted, Flow control: if … then Flow control: if … thenif the Vipsi command syntax: Arguments Glossary: Argumentsargument 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: Expressionexpression with Vipsi command syntax: Operators Operators Glossary: Operatoroperators.
e.g.:
Text functions: fullpathfullpath "~" = "/home/kio/"
<text> = Text functions: hexstrhexstr ( <number> )
<text> = Text functions: hexstrhexstr ( <number>, <digits> )
Text functions: convert Instructions: convertConvert integer Glossary: number, num_valnumber to Integer numbers: Hexadecimal Floating point: Hexadecimal Text functions: hexstrhexadecimal Vipsi command syntax: Literals Glossary: Literalliteral representation.
Text functions: convert Instructions: convertConvert <number> to a Integer numbers: Hexadecimal Floating point: Hexadecimal Text functions: hexstrhexadecimal digit Data Types: Text Text functions: stringstring. Resulting <text> is sized to fit Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or sized according to <digits>, which must be a numeric Glossary: Valuevalue too, truncating Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or padding '0's Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or 'F's to Flow control: if … then Flow control: try … thenthe left.
Positive Glossary: Valuevalues are padded with '0's to Flow control: if … then Flow control: try … thenthe left, negative Glossary: Valuevalues are printed as their -1-Operators: Bitwise Not "~"complement, as is common for Number literals: Integer numbersinteger numbers, Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and padded with 'F's to Flow control: if … then Flow control: try … thenthe left. Flow control: if … thenIf no <digits> are given, Flow control: if … then Flow control: try … thenthen negative Glossary: Valuevalues are always printed with Flow control: if … then Flow control: try … thenthe most significant bit set, e.g. they always start with a digit in range '8' to 'F'.
e.g.:
vipsi> Text functions: hexstrhexstr(240) F0
vipsi> Text functions: hexstrhexstr(240,4) 00F0
vipsi> Text functions: hexstrhexstr(240,1) 0
vipsi> Text functions: hexstrhexstr(-240,4) FF10
vipsi> Text functions: hexstrhexstr(-240,8) FFFFFF10
vipsi> Text functions: hexstrhexstr(-240) F10
vipsi> Text functions: hexstrhexstr(1e20) 56BC75E2D63100000
vipsi>
<text> = Text functions: info Shell Immediate Commands: infoinfo <text>
<text> = Text functions: info Shell Immediate Commands: infoinfo ( <text> )
Querry information on a built-in List functions: words Shell Immediate Commands: wordsword.
Flow control: returnReturns a Glossary: text, text_valtext value.
Flow control: returnReturns usage information on The Built-in Wordsthe built-in word which Vipsi command syntax: Identifiers (names) Identifiers, names Operators: Make Identifier "@" Text functions: name Glossary: Name, Identifiername was passed in Flow control: if … then Flow control: try … thenthe Data Types: Text Item selector "[]": Text Glossary: text, text_valtext Vipsi command syntax: Arguments Glossary: Argumentsargument. (Version 0.8.7)
Operators: Bitwise Not "~" Operators: Boolean Negation "!"Note: List functions: thisthis may be changed to a Data Types: Lists and arrays Item selector "[]": Lists Glossary: list, list_vallist in Flow control: if … then Flow control: try … thenthe future.
As with all Vipsi command syntax: Functions Functions Glossary: Functionfunctions which accept exactly one Vipsi command syntax: Arguments Glossary: Argumentsargument Flow control: if … then Flow control: try … thenthe Separators: Round brackets "( … )" Functions with varying return types: bracket expression "()"parenthesis are optional Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and may be omitted Flow control: if … then Flow control: if … thenif the Vipsi command syntax: Arguments Glossary: Argumentsargument is no Vipsi command syntax: Expressions Glossary: Expressionexpression with Vipsi command syntax: Operators Operators Glossary: Operatoroperators.
e.g.:
vipsi> Instructions: putput Constants: nlnl,Text functions: info Shell Immediate Commands: infoinfo("Flow control: do … loopdo")
syntax: Flow control: do … loop Flow control: do … loopdo … loop
repeat Vipsi command syntax: Statements Glossary: Statementstatements between Flow control: do … loopdo Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and Flow control: do … looploop.
e.g.: Instructions: var How does VScript::Value() work?: Var*&var i=1; Flow control: do … loopdo; Instructions: putput i; Flow control: whilewhile i<10; i++; Flow control: do … looploop;
vipsi>
There is also a Shell Immediate Commands Invariants: Shell immediate commandsshell immediate command Text functions: info Shell Immediate Commands: infoinfo which prints Flow control: if … then Flow control: try … thenthe Data Types: Text Item selector "[]": Text Glossary: text, text_valtext.
In order to Operators: Call procedure "()"call function Text functions: info Shell Immediate Commands: infoinfo in Flow control: if … then Flow control: try … thenthe shell, you must prevent that Text functions: info Shell Immediate Commands: infoinfo is recognized as Flow control: if … then Flow control: try … thenthe Shell Immediate Commands Invariants: Shell immediate commandsshell immediate command. List functions: thisThis can be done by Operators: Bitwise Not "~" Operators: Boolean Negation "!"not starting in column 1, e.g. prepending a space Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or ";", Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or by using Instructions: putput just like you had to Flow control: do … loopdo in a Example Scripts: CGI Scripts Example Scripts: Scriptsscript.
<text> = Text functions: leftstrleftstr ( <text>, <number> )
Flow control: returnReturns substring consisting of <number> characters from Flow control: if … then Flow control: try … thenthe left side of Flow control: if … then Flow control: try … thenthe <text>.
Flow control: if … thenIf <number> reaches beyond Flow control: if … then Flow control: try … thenthe Flow control: end Shell Immediate Commands: exit, quit, endend of Flow control: if … then Flow control: try … thenthe Data Types: Text Item selector "[]": Text Glossary: text, text_valtext, Flow control: if … then Flow control: try … thenthen Flow control: if … then Flow control: try … thenthe returned Data Types: Text Item selector "[]": Text Glossary: text, text_valtext is truncated to Flow control: if … then Flow control: try … thenthe dir: lengthlength of Flow control: if … then Flow control: try … thenthe source Data Types: Text Item selector "[]": Text Glossary: text, text_valtext.
Numeric functions: indexIndexes start Operators: Make Identifier "@"at 1.
e.g.:
Text functions: leftstrleftstr ( "1234567890", 3 ) = "123"
Text functions: leftstrleftstr ( "1234567890", 99 ) = "1234567890"
Text functions: leftstrleftstr ( "1234567890", -5 ) = ""
Functionally equivalent to
<text> = [ to <number> ]
<text> = Text functions: link Instructions: linklink <path>
<text> = Text functions: link Instructions: linklink ( <path> )
Instructions: readRead contents of symbolic Text functions: link Instructions: linklink.
Instructions: readRead Flow control: if … then Flow control: try … thenthe contents of Flow control: if … then Flow control: try … thenthe symbolic Text functions: link Instructions: linklink (Operators: Bitwise Not "~" Operators: Boolean Negation "!"not Flow control: if … then Flow control: try … thenthe Text functions: file Instructions: filefile it may point to) Operators: Make Identifier "@"at Text functions: file Instructions: filefile system position <path>. Flow control: returnReturns a <text> Glossary: Valuevalue. <path> must be a Glossary: text, text_valtext value Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and may be a relative Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or absolute path, contain symbolic Text functions: link Instructions: linklinks, Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or start with "~" for Flow control: if … then Flow control: try … thenthe user's home directory. All symbolic Text functions: link Instructions: linklinks are followed, except Flow control: if … then Flow control: try … thenthe last one.
As with all Vipsi command syntax: Functions Functions Glossary: Functionfunctions which take exactly one Vipsi command syntax: Arguments Glossary: Argumentsargument, Flow control: if … then Flow control: try … thenthe Separators: Round brackets "( … )" Functions with varying return types: bracket expression "()"parenthesis may be omitted, Flow control: if … then Flow control: if … thenif the Vipsi command syntax: Arguments Glossary: Argumentsargument 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: Expressionexpression with Vipsi command syntax: Operators Operators Glossary: Operatoroperators.
There is also an Vipsi command syntax: Instructions Instructions Glossary: Instructioninstruction Text functions: link Instructions: linklink which sets a Text functions: link Instructions: linklink.
e.g.
Instructions: var How does VScript::Value() work?: Var*&var myLink = "zzz"
Instructions: putput "Text functions: link Instructions: linklink ", myLink,
"contains ", Text functions: link Instructions: linklink myLink,
"which resolves to ", Text functions: fullpathfullpath myLink
<text> = Text functions: lowerstrlowerstr ( <text> )
<text> = Text functions: lowerstrlowerstr <text>
Text functions: convert Instructions: convertConvert <text> to all Text functions: lowerstrlowercase characters.
Currently works with all unicode characters in range [0 ... $FFFF]. There are a few ones beyond, which are Operators: Bitwise Not "~" Operators: Boolean Negation "!"not yet converted.
As with all Vipsi command syntax: Functions Functions Glossary: Functionfunctions which take exactly one Vipsi command syntax: Arguments Glossary: Argumentsargument, Flow control: if … then Flow control: try … thenthe Separators: Round brackets "( … )" Functions with varying return types: bracket expression "()"parenthesis may be omitted, Flow control: if … then Flow control: if … thenif the Vipsi command syntax: Arguments Glossary: Argumentsargument 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: Expressionexpression with Vipsi command syntax: Operators Operators Glossary: Operatoroperators.
e.g.
Text functions: lowerstrlowerstr "Hello World!" = "hello world!"
Text functions: lowerstrlowerstr("Hello"#"World!") = "helloworld!"
<text> = Text functions: midstrmidstr ( <text>, <index>, <number> )
<text> = Text functions: midstrmidstr ( <text>, <index> )
Flow control: returnReturn substring starting Operators: Make Identifier "@"at <index> Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and including Flow control: if … then Flow control: try … thenthe Flow control: nextnext <number> characters. Numeric functions: indexIndex must be a numeric Glossary: Valuevalue.
Flow control: if … then Flow control: if … thenIf the dir: lengthlength is omitted, Flow control: if … then Flow control: try … thenthen Flow control: returnreturn all Data Types: Text Item selector "[]": Text Glossary: text, text_valtext up to Flow control: if … then Flow control: try … thenthe Flow control: end Shell Immediate Commands: exit, quit, endend. Flow control: if … thenIf <number> reaches beyond Flow control: if … then Flow control: try … thenthe Flow control: end Shell Immediate Commands: exit, quit, endend of Flow control: if … then Flow control: try … thenthe source Data Types: Text Item selector "[]": Text Glossary: text, text_valtext, Flow control: if … then Flow control: try … thenthen Flow control: if … then Flow control: try … thenthe returned Data Types: Text Item selector "[]": Text Glossary: text, text_valtext is truncated. Flow control: if … thenIf <index> already sterts behind Data Types: Text Item selector "[]": Text Glossary: text, text_valtext Flow control: end Shell Immediate Commands: exit, quit, endend, Flow control: if … then Flow control: try … thenthen Flow control: if … then Flow control: try … thenthe returned Data Types: Text Item selector "[]": Text Glossary: text, text_valtext is empty. Flow control: if … thenIf Numeric functions: indexindex points to a position before Flow control: if … then Flow control: try … thenthe beginning of Flow control: if … then Flow control: try … thenthe Data Types: Text Item selector "[]": Text Glossary: text, text_valtext, Flow control: if … then Flow control: try … thenthen Numeric functions: indexindex is set to 1 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 <number> is reduced accordingly.
Numeric functions: indexIndexes start Operators: Make Identifier "@"at 1.
e.g.:
Text functions: midstrmidstr ( "1234567890", 3, 4 ) = "3456"
Text functions: midstrmidstr ( "1234567890", 8, 99 ) = "890"
Text functions: midstrmidstr ( "1234567890", 5 ) = "567890"
Text functions: midstrmidstr ( "1234567890", 8, -4 ) = ""
Text functions: midstrmidstr ( "1234567890", -4, 8 ) = "123"
<text> = Vipsi command syntax: Identifiers (names) Identifiers, names Operators: Make Identifier "@" Text functions: name Glossary: Name, Identifiername <variable>
<text> = Vipsi command syntax: Identifiers (names) Identifiers, names Operators: Make Identifier "@" Text functions: name Glossary: Name, Identifiername ( <variable> )
Flow control: returnReturn vipsi - the friendly one.: The namethe name of a <variable>.
You will in most cases want to querry vipsi - the friendly one.: The namethe names of Data Types: Lists and arrays Item selector "[]": Lists Glossary: list, list_vallist items.
As with all Vipsi command syntax: Functions Functions Glossary: Functionfunctions which take exactly one Vipsi command syntax: Arguments Glossary: Argumentsargument, Flow control: if … then Flow control: try … thenthe Separators: Round brackets "( … )" Functions with varying return types: bracket expression "()"parenthesis may be omitted, Flow control: if … then Flow control: if … thenif the Vipsi command syntax: Arguments Glossary: Argumentsargument 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: Expressionexpression with Vipsi command syntax: Operators Operators Glossary: Operatoroperators.
e.g.:
Instructions: putput "a[0] is named: ", Vipsi command syntax: Identifiers (names) Identifiers, names Operators: Make Identifier "@" Text functions: name Glossary: Name, Identifiername a[0], Constants: nlnl
<text> = Text functions: replace Instructions: replacereplace ( <text>, <oldtext>, <newtext> )
Text functions: replace Instructions: replaceReplace in <text> any occurance of <oldtext> with <newtext>. Flow control: if … then Flow control: try … thenThe converted Data Types: Text Item selector "[]": Text Glossary: text, text_valtext is returned as result.
Flow control: if … then Flow control: try … thenThe source Data Types: Text Item selector "[]": Text Glossary: text, text_valtext is scanned from left to right Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and replaced Data Types: Text Item selector "[]": Text Glossary: text, text_valtext is Operators: Bitwise Not "~" Operators: Boolean Negation "!"not scanned again. Flow control: if … then Flow control: if … thenIf the search Data Types: Text Item selector "[]": Text Glossary: text, text_valtext <oldtext> is an empty Data Types: Text Text functions: stringstring, Flow control: if … then Flow control: try … thenthen nothing is done.
version 0.8.7: Text functions: replace Instructions: replacereplace Flow control: do … loopdoes Operators: Bitwise Not "~" Operators: Boolean Negation "!"not yet work on Data Types: Lists and arrays Item selector "[]": Lists Glossary: list, list_vallists. List functions: thisthis will be implemented in Flow control: if … then Flow control: try … thenthe near future.
There is also an Vipsi command syntax: Instructions Instructions Glossary: Instructioninstruction Text functions: replace Instructions: replacereplace which Text functions: replace Instructions: replacereplaces Flow control: if … then Flow control: try … thenthe target Data Types: Text Item selector "[]": Text Glossary: text, text_valtext Glossary: Variable, var_refvariable.
e.g.:
Instructions: putput Text functions: replace Instructions: replacereplace ( my_email_addr, "@", "@" ) // obscure mailto Text functions: link Instructions: linklink
<text> = Text functions: rightstrrightstr ( <text>, <number> )
Flow control: returnReturns substring consisting of <number> characters from Flow control: if … then Flow control: try … thenthe right side of Flow control: if … then Flow control: try … thenthe <text>. Flow control: if … thenIf Glossary: number, num_valnumber is larger than Flow control: if … then Flow control: try … thenthe Data Types: Text Item selector "[]": Text Glossary: text, text_valtext dir: lengthlength, Flow control: if … then Flow control: try … thenthen Flow control: if … then Flow control: try … thenthe returned Data Types: Text Item selector "[]": Text Glossary: text, text_valtext is truncated to Flow control: if … then Flow control: try … thenthe source Data Types: Text Item selector "[]": Text Glossary: text, text_valtext dir: lengthlength.
e.g.:
Text functions: rightstrrightstr ( "1234567890", 3 ) = "890"
Text functions: rightstrrightstr ( "1234567890", 99 ) = "1234567890"
Text functions: rightstrrightstr ( "1234567890", -5 ) = ""
<text> = Text functions: spacestrspacestr ( <number> )
<text> = Text functions: spacestrspacestr ( <number>, <pattern> )
Flow control: returnReturn a Data Types: Text Item selector "[]": Text Glossary: text, text_valtext filled with <number> spaces.
Text functions: spacestrspacestr optionally accepts a fill pattern, which must be a Glossary: text, text_valtext value. Flow control: if … thenIf List functions: thisthis pattern is longer than 1 character, Flow control: if … then Flow control: try … thenthen Flow control: if … then Flow control: try … thenthe resulting Data Types: Text Item selector "[]": Text Glossary: text, text_valtext will be <number> * Numeric functions: countcount(<pattern>) characters long. Flow control: if … then Flow control: if … thenIf the fill pattern is an empty Data Types: Text Item selector "[]": Text Glossary: text, text_valtext, Flow control: if … then Flow control: try … thenthen Flow control: if … then Flow control: try … thenthe result is an empty Data Types: Text Item selector "[]": Text Glossary: text, text_valtext too.
e.g.:
Instructions: var How does VScript::Value() work?: Var*&var spc=Text functions: spacestrspacestr(77);
Instructions: var How does VScript::Value() work?: Var*&var foo=Text functions: spacestrspacestr(123,""); Instructions: putput Numeric functions: countcount(foo);
Instructions: putput Text functions: spacestrspacestr(100,"hello!");
<text> = Data Types: Text Text functions: stringstring ( <value> )
<text> = Data Types: Text Text functions: stringstring <value>
Text functions: convert Instructions: convertConverts Flow control: if … then Flow control: try … thenthe <value> to <text> Data Types: Text Item selector "[]": Text Glossary: text, text_valtext representation. Flow control: if … thenIf <value> is already a Data Types: Text Item selector "[]": Text Glossary: text, text_valtext, Flow control: if … then Flow control: try … thenthen Flow control: if … then Flow control: try … thenthe result is just that Data Types: Text Item selector "[]": Text Glossary: text, text_valtext. Vipsi command syntax: Procedures Data Types: Procedures Glossary: ProcedureProcedures, Data Types: Lists and arrays Item selector "[]": Lists Glossary: list, list_vallists Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and Data Types: Numbersnumbers are converted to their Vipsi command syntax: Literals Glossary: Literalliteral representation: Vipsi command syntax: Procedures Data Types: Procedures Glossary: Procedureprocedures are disassembled, Data Types: Lists and arrays Item selector "[]": Lists Glossary: list, list_vallists are converted to printable Data Types: Text Item selector "[]": Text Glossary: text, text_valtext Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and Data Types: Numbersnumbers are converted to integer, Number literals: Floating pointfloating point Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or scientific Number literals: Decimal Integer numbers: Decimal Floating point: Decimaldecimal notation as required. Flow control: if … then Flow control: try … thenThe conversion guarantees that Flow control: if … then Flow control: try … thenthe Glossary: number, num_valnumber, when re-interpreted, will yield Flow control: if … then Flow control: try … thenthe exact same Glossary: number, num_valnumber as before.
As with all Vipsi command syntax: Functions Functions Glossary: Functionfunctions which take exactly one Vipsi command syntax: Arguments Glossary: Argumentsargument, Flow control: if … then Flow control: try … thenthe Separators: Round brackets "( … )" Functions with varying return types: bracket expression "()"parenthesis may be omitted, Flow control: if … then Flow control: if … thenif the Vipsi command syntax: Arguments Glossary: Argumentsargument 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: Expressionexpression with Vipsi command syntax: Operators Operators Glossary: Operatoroperators.
e.g.:
Data Types: Text Text functions: stringstring 33 = "33"
Data Types: Text Text functions: stringstring(47+11) = "58"
Data Types: Text Text functions: stringstring(Instructions: procproc(a){Instructions: putput a}) = "Instructions: procproc ( a ) { Instructions: putput a } "
Data Types: Text Text functions: stringstring({a=1,b=2,"x"}) = "{ a=1, b=2, \"x\" }"
Data Types: Text Text functions: stringstring("anton") = "anton"
<text> = Text functions: substrsubstr ( <text>, <startindex>, <endindex> )
<text> = Text functions: substrsubstr ( <text>, <startindex> )
Flow control: returnReturn substring from <startindex> to <endindex>.
Flow control: returnReturns substring from start Numeric functions: indexindex to Flow control: end Shell Immediate Commands: exit, quit, endend Numeric functions: indexindex inclusive, resulting in <startindex>-<endindex>+1 characters. Flow control: if … then Flow control: if … thenIf the Flow control: end Shell Immediate Commands: exit, quit, endend Numeric functions: indexindex is omitted, Flow control: if … then Flow control: try … thenthen Flow control: returnreturn all characters to Flow control: if … then Flow control: try … thenthe Flow control: end Shell Immediate Commands: exit, quit, endend of Data Types: Text Item selector "[]": Text Glossary: text, text_valtext.
Numeric functions: indexIndexes start Operators: Make Identifier "@"at 1.
Flow control: if … then Flow control: try … thenThe start 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, endend Numeric functions: indexindex are forced inside Flow control: if … then Flow control: try … thenthe Data Types: Text Item selector "[]": Text Glossary: text, text_valtext Flow control: if … thenif required. Flow control: if … then Flow control: if … thenIf the start Numeric functions: indexindex is greater than Flow control: end Shell Immediate Commands: exit, quit, endend Numeric functions: indexindex Flow control: if … then Flow control: try … thenthen an empty Data Types: Text Item selector "[]": Text Glossary: text, text_valtext is returned.
e.g.:
Text functions: substrsubstr ( "1234567890", 3, 6 ) = "3456"
Text functions: substrsubstr ( "1234567890", 8, 99 ) = "890"
Text functions: substrsubstr ( "1234567890", 8, 4 ) = ""
Text functions: substrsubstr ( "1234567890", 8 ) = "890"
Functionally equivalent to:
<text> = <text> [ <startindex> to <endindex> ]
<text> = <text> [ <startindex> to ]
Execute another program.
<text> = Text functions: sys Instructions: syssys <progName>
<text> = Text functions: sys Instructions: syssys <progName>, <value> [, ...]
<text> = Text functions: sys Instructions: syssys <progName>, <list>
Flow control: if … then Flow control: try … thenThe Data Types: Text Item selector "[]": Text Glossary: text, text_valtext written to Constants: stderrstderr is immediately written to vipsi's Constants: stderrstderr. Constants: stdinstdin is also left connected to vipsi's Constants: stdinstdin.
Flow control: if … then Flow control: try … thenThe Data Types: Text Item selector "[]": Text Glossary: text, text_valtext written to Constants: stdoutstdout is returned as a Glossary: text, text_valtext value after program execution. List functions: thisThis is slightly weird, because List functions: thisthis way output to Constants: stdoutstdout Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and Constants: stderrstderr are Operators: Bitwise Not "~" Operators: Boolean Negation "!"not kept in order Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and List functions: thisthis may be reviewed some time.
Flow control: if … then Flow control: try … thenThe program Vipsi command syntax: Identifiers (names) Identifiers, names Operators: Make Identifier "@" Text functions: name Glossary: Name, Identifiername, a Glossary: text, text_valtext value, may be given as an absolute Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or relative path Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or only as Flow control: if … then Flow control: try … thenthe command Vipsi command syntax: Identifiers (names) Identifiers, names Operators: Make Identifier "@" Text functions: name Glossary: Name, Identifiername itself, Flow control: if … thenif it can be found traversing Flow control: if … then Flow control: try … thenthe PATH environment Glossary: Variable, var_refvariable. In essence List functions: thisthis means: you can give Flow control: if … then Flow control: try … thenthe program Vipsi command syntax: Identifiers (names) Identifiers, names Operators: Make Identifier "@" Text functions: name Glossary: Name, Identifiername as you would type it on Flow control: if … then Flow control: try … thenthe command line.
Vipsi command syntax: Arguments Glossary: ArgumentsArguments may be either a virtually unlimited Data Types: Lists and arrays Item selector "[]": Lists Glossary: list, list_vallist 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 Data Types: Lists and arrays Item selector "[]": Lists Glossary: list, list_vallist as a single Vipsi command syntax: Arguments Glossary: Argumentsargument, Flow control: if … then Flow control: try … thenthen Flow control: if … then Flow control: try … thenthe Data Types: Lists and arrays Item selector "[]": Lists Glossary: list, list_vallist items are taken as Vipsi command syntax: Arguments Glossary: Argumentsarguments for Flow control: if … then Flow control: try … thenthe program.
Any Vipsi command syntax: Arguments Glossary: Argumentsargument is converted Text functions: stringto text before Flow control: if … then Flow control: try … thenthe external program is called, just because only Data Types: Text Item selector "[]": Text Glossary: text, text_valtexts can be passed to other programs.
Operators: Bitwise Not "~" Operators: Boolean Negation "!"Note, that you cannot pass a Data Types: Lists and arrays Item selector "[]": Lists Glossary: list, list_vallist as a single Vipsi command syntax: Arguments Glossary: Argumentsargument, because Flow control: if … then Flow control: try … thenthen Flow control: if … then Flow control: try … thenthe Data Types: Lists and arrays Item selector "[]": Lists Glossary: list, list_vallist items would be taken on behalf, as said above.
Also Operators: Bitwise Not "~" Operators: Boolean Negation "!"note, that Operators: Multiply "*"wildcard patterns are Operators: Bitwise Not "~" Operators: Boolean Negation "!"not expanded!
Instructions: putput Text functions: sys Instructions: syssys "ls"
Instructions: putput Text functions: sys Instructions: syssys "ls", "-lR"
Instructions: putput Text functions: sys Instructions: syssys "rm", "anton", "berta"
Instructions: putput Text functions: sys Instructions: syssys "rm", { "anton", "berta" }
Instructions: putPut Flow control: if … then Flow control: try … thenthe Data Types: Lists and arrays Item selector "[]": Lists Glossary: list, list_vallist 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 Text functions: convert Instructions: convertconvert it Text functions: stringto text with Vipsi command syntax: Functions Functions Glossary: Functionfunction Data Types: Text Text functions: stringstring:
Instructions: putput Text functions: sys Instructions: syssys "echo", { { "a", "Data Types: Lists and arrays Item selector "[]": Lists Glossary: list, list_vallist" } }
Instructions: putput Text functions: sys Instructions: syssys "echo", Data Types: Text Text functions: stringstring( { "a", "Data Types: Lists and arrays Item selector "[]": Lists Glossary: list, list_vallist" } )
There is also an Vipsi command syntax: Instructions Instructions Glossary: Instructioninstruction Text functions: sys Instructions: syssys, which prints Flow control: if … then Flow control: try … thenthe Data Types: Text Item selector "[]": Text Glossary: text, text_valtext written to Constants: stdoutstdout to Constants: stdoutstdout. (sic!)
<text> = Text functions: upperstrupperstr ( <text> )
<text> = Text functions: upperstrupperstr <text>
Text functions: convert Instructions: convertConverts <text> to all Text functions: upperstruppercase characters.
Currently works with all unicode characters in range [0 ... $FFFF]. There are a few ones beyond, which are Operators: Bitwise Not "~" Operators: Boolean Negation "!"not yet converted.
As with all Vipsi command syntax: Functions Functions Glossary: Functionfunctions which take exactly one Vipsi command syntax: Arguments Glossary: Argumentsargument, Flow control: if … then Flow control: try … thenthe Separators: Round brackets "( … )" Functions with varying return types: bracket expression "()"parenthesis may be omitted, Flow control: if … then Flow control: if … thenif the Vipsi command syntax: Arguments Glossary: Argumentsargument 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: Expressionexpression with Vipsi command syntax: Operators Operators Glossary: Operatoroperators.
e.g.
Text functions: upperstrupperstr "Hello World!" = "HELLO WORLD!"
Text functions: upperstrupperstr("Hello"#"World!") = "HELLOWORLD!"
|