List functions: thisThis group of Vipsi command syntax: Instructions Instructions Glossary: Instructioninstructions modifies Flow control: if … then Flow control: try … thenthe linear flow of program execution into Flow controlbranches Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and Flow control: do … looploops. There is also Flow control: if … then Flow control: try … thenthe error catcher with 'Flow control: try … thentry' Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and Example Scripts: CGI Scripts Example Scripts: Scriptsscript termination with 'Flow control: end Shell Immediate Commands: exit, quit, endend'.
Flow control: do … loopdo
<statements>
Flow control: do … looploop
Flow control: do … loopdo
Flow control: whilewhile <condition>
Flow control: untiluntil <condition>
Flow control: if … thenif <value> Flow control: nextnext Flow control: if … then Flow control: try … thenthen
Flow control: if … thenif <value> Flow control: exit Shell Immediate Commands: exit, quit, endexit Flow control: if … then Flow control: try … thenthen
Flow control: do … looploop
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.
When Flow control: if … then Flow control: try … thenthe Flow control: do … looploop is entered Operators: Make Identifier "@"at Flow control: do … loopdo nothing special happens. But when Flow control: if … then Flow control: try … thenthe program execution reaches Flow control: do … looploop, Flow control: if … then Flow control: try … thenthen Flow control: if … then Flow control: try … thenthe program jumps back to Flow control: if … then Flow control: try … thenthe matching Flow control: do … loopdo Vipsi command syntax: Instructions Instructions Glossary: Instructioninstruction. do-loops can be nested to any level.
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;
Flow control: do … loopdo
<statements>
Flow control: whilewhile <condition>
<statements>
Flow control: do … looploop
Conditionally leave Flow control: if … then Flow control: try … thenthe Flow control: do … looploop. Flow control: if … then Flow control: try … thenThe Flow controlcondition must be a numeric Glossary: Valuevalue. Flow control: if … then Flow control: if … thenIf the <condition> is false (==0) Flow control: if … then Flow control: try … thenthen Flow control: if … then Flow control: try … thenthe Flow control: do … looploop is aborted Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and program execution resumes behind Flow control: do … looploop.
e.g.
Instructions: var How does VScript::Value() work?: Var*&var d = List functions: dir Instructions: dir Shell Immediate Commands: dirdir(".")
Instructions: putput " current directory contents: ", Constants: nlnl
Instructions: var How does VScript::Value() work?: Var*&var i=0
Flow control: do … loopdo
Flow control: whilewhile i <= Numeric functions: countcount d
Instructions: putput d.dir: fnamefname, Constants: nlnl
Flow control: do … looploop
Flow control: do … loopdo
<statements>
Flow control: untiluntil <condition>
<statements>
Flow control: do … looploop
Conditionally leave Flow control: if … then Flow control: try … thenthe Flow control: do … looploop. Flow control: if … then Flow control: try … thenThe Flow controlcondition must be a numeric Glossary: Valuevalue. Flow control: if … then Flow control: if … thenIf the <condition> is true (!=0) Flow control: if … then Flow control: try … thenthen Flow control: if … then Flow control: try … thenthe Flow control: do … looploop is aborted Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and program execution resumes behind Flow control: do … looploop. Tis is just Flow control: if … then Flow control: try … thenthe same as Flow control: whilewhile, except with reverted Flow controlcondition.
e.g.
Flow control: do … loopdo
Instructions: var How does VScript::Value() work?: Var*&var n=""
Instructions: putput #stdin, "gimme a Glossary: number, num_valnumber: "
Instructions: getget n
Flow control: untiluntil n=="" // break from Flow control: do … looploop
n = Numeric functions: intint(Functions with varying return types: eval Instructions: evaleval(n))
Instructions: var How does VScript::Value() work?: Var*&var a = 1
Flow control: do … loopdo
Flow control: whilewhile (a+=2) <= Numeric functions: sqrtsqrt(n)
Flow control: untiluntil Numeric functions: fractfract(n/a) == 0
Flow control: do … looploop
Flow control: if … thenif a > Numeric functions: sqrtsqrt(n) Instructions: putput " is prime", Constants: nlnl
Flow control: if … then Flow control: try … thenelse Instructions: putput " = ", a, " * ", n/a, Constants: nlnl
Flow control: if … then Flow control: try … thenthen
Flow control: do … looploop
Flow control: do … loopdo
<statements>
Flow control: exit Shell Immediate Commands: exit, quit, endexit
<statements>
Flow control: do … looploop
Unconditionally leave Flow control: if … then Flow control: try … thenthe Flow control: do … looploop. Flow control: if … then Flow control: try … thenThe program execution resumes behind Flow control: do … looploop. Since it makes no sense otherwise, Flow control: exit Shell Immediate Commands: exit, quit, endexit is most likely within a conditional Flow controlbranch between Flow control: if … thenif 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.
e.g.:
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
Flow control: do … loopdo
<statements>
Flow control: nextnext
<statements>
Flow control: do … looploop
Jump back to Flow control: do … loopdo Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and restart execution of Flow control: if … then Flow control: try … thenthe Flow control: do … looploop. List functions: thisThis is just what Flow control: do … looploop Flow control: do … loopdoes, Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and since it would make no sense otherwise, Flow control: nextnext is most likely within a conditional Flow controlbranch between Flow control: if … thenif 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.
e.g.
Instructions: var How does VScript::Value() work?: Var*&var i=1
Flow control: do … loopdo
i+=i
Flow control: if … thenif i<100 Flow control: nextnext Flow control: if … then Flow control: try … thenthen
Flow control: exit Shell Immediate Commands: exit, quit, endexit
Numeric functions: log Numeric functions: loge Instructions: loglog "never seen"
Flow control: do … looploop
Instructions: putput "i = ", i, Constants: nlnl
Flow control: end Shell Immediate Commands: exit, quit, endend
Flow control: end Shell Immediate Commands: exit, quit, endend 0
Flow control: end Shell Immediate Commands: exit, quit, endend 1
Flow control: end Shell Immediate Commands: exit, quit, endend <value>
Flow control: end Shell Immediate Commands: exit, quit, endEnd of Example Scripts: CGI Scripts Example Scripts: Scriptsscript optionally returning a Glossary: Valuevalue.
Flow control: whileWhile Flow control: returnreturn, when executed in a Vipsi command syntax: Procedures Data Types: Procedures Glossary: Procedureprocedure, will only Flow control: returnreturn from Flow control: if … then Flow control: try … thenthe Vipsi command syntax: Procedures Data Types: Procedures Glossary: Procedureprocedure, Flow control: end Shell Immediate Commands: exit, quit, endend allways Flow control: exit Shell Immediate Commands: exit, quit, endexits from Flow control: if … then Flow control: try … thenthe whole Example Scripts: CGI Scripts Example Scripts: Scriptsscript.
Flow control: end Shell Immediate Commands: exit, quit, endend may optionall Flow control: returnreturn a Shell Scripts: Return values Appendix: Return valuesreturn value. Whether it is expected to Flow control: do … loopdo so Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and which Glossary: Valuevalues are acceptable depends on Flow control: if … then Flow control: try … thenthe invocation of Flow control: if … then Flow control: try … thenthe Example Scripts: CGI Scripts Example Scripts: Scriptsscript.
- Flow control: if … thenIf invoked from Flow control: if … then
Flow control: try … thenthe bash Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or similar, Flow control: if … then Flow control: try … thenthe Example Scripts: CGI Scripts Example Scripts: Scriptsscript Instructions: getgets called via Flow control: if … then Flow control: try … thenthe unix process forking mechanism. Flow control: if … then Flow control: try … thenThen you can Flow control: returnreturn only tiny little integers in range [0 to 255]. List functions: thisThis Shell Scripts: Return values Appendix: Return valuesreturn value is expected to be some kind of error code, Operators: Bitwise Not "~" Operators: Boolean Negation "!"not Flow control: if … then Flow control: try … thenthe "result" of Flow control: if … then Flow control: try … thenthe program. 0 typically means 'success' any other Glossary: Valuevalue indicates an error. Flow control: if … thenIf a Example Scripts: CGI Scripts Example Scripts: Scriptsscript Flow control: do … loopdoes Operators: Bitwise Not "~" Operators: Boolean Negation "!"not Flow control: returnreturn a result, that is, Flow control: if … thenif it executes Flow control: end Shell Immediate Commands: exit, quit, endend with no Vipsi command syntax: Arguments Glossary: Argumentsargument Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or runs beyond Flow control: if … then Flow control: try … thenthe Text functions: file Instructions: filefile 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 Shell Scripts: Return values Appendix: Return valuesreturn value is set to 0, which is likely to indicate 'no error'. Don't rely on Flow control: if … then Flow control: try … thenthe exact Glossary: Valuevalue of Flow control: if … then Flow control: try … thenthe Flow control: returnreturn code! Flow control: if … then Flow control: try … thenThe bash itself Flow control: returnreturns 126 Flow control: if … thenif a command was found but Operators: Bitwise Not "~" Operators: Boolean Negation "!"not executable, 127 Flow control: if … thenif a command was Operators: Bitwise Not "~" Operators: Boolean Negation "!"not found, 128+N Flow control: if … then Flow control: if … thenif the command crashed with exception N Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and possibly any other error code for other Flow controlconditions. In Operators: Add "+"addition vipsi Flow control: returnreturns 125 in Flow control: if … then Flow control: try … thenthe following cases: Flow control: if … then Flow control: if … thenif the Example Scripts: CGI Scripts Example Scripts: Scriptsscript crashes with an error Flow control: if … then Flow control: try … thenthen List functions: thisthis error code is returned Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or 125 Flow control: if … then Flow control: if … thenif the error code was too high. Flow control: if … then Flow control: if … thenIf the Example Scripts: CGI Scripts Example Scripts: Scriptsscript Flow control: returnreturns a non-numeric Glossary: Valuevalue Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or a numeric Glossary: Valuevalue out of range, Flow control: if … then Flow control: try … thenthen Flow control: if … then Flow control: try … thenthe result is substituted with 125 too.
- Flow control: if … thenIf invoked from another vip Example Scripts: CGI Scripts
Example Scripts: Scriptsscript Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or Flow control: if … then Flow control: try … thenthe vipsi command line using Text functions: sys Instructions: syssys Flow control: if … then Flow control: try … thenthen Flow control: if … then Flow control: try … thenthe Example Scripts: CGI Scripts Example Scripts: Scriptsscript Instructions: getgets called in Flow control: if … then Flow control: try … thenthe same way as from Flow control: if … then Flow control: try … thenthe bash shell. All said there is true here too, except for Flow control: if … then Flow control: try … thenthe additional result codes used by Flow control: if … then Flow control: try … thenthe bash. Flow control: if … then Flow control: try … thenThe Shell Scripts: Return values Appendix: Return valuesreturn value from Flow control: if … then Flow control: try … thenthe invoked Example Scripts: CGI Scripts Example Scripts: Scriptsscript is Operators: Bitwise Not "~" Operators: Boolean Negation "!"not returned to Flow control: if … then Flow control: try … thenthe Functions with varying return types: call Instructions: callcaller, Flow control: if … then Flow control: try … thenthe Functions with varying return types: call Instructions: callcaller Instructions: getgets Flow control: if … then Flow control: try … thenthe Example Scripts: CGI Scripts Example Scripts: Scriptsscript output to Constants: stdoutstdout instead. Flow control: if … thenIf an error in Flow control: if … then Flow control: try … thenthe Example Scripts: CGI Scripts Example Scripts: Scriptsscript occurs Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or Flow control: if … then Flow control: if … thenif the Example Scripts: CGI Scripts Example Scripts: Scriptsscript Flow control: returnreturns a non-zero Glossary: Valuevalue, Flow control: if … then Flow control: try … thenthen an error is triggered in Flow control: if … then Flow control: try … thenthe Functions with varying return types: call Instructions: callcaller Example Scripts: CGI Scripts Example Scripts: Scriptsscript which must be handled with Flow control: try … thentry. errorstr Flow control: if … then Flow control: try … thenthen contains some useful error message.
- Flow control: if … thenIf invoked from another vip Example Scripts: CGI Scripts
Example Scripts: Scriptsscript Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or Flow control: if … then Flow control: try … thenthe vipsi command line using Functions with varying return types: call Instructions: callcall Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or Functions with varying return types: include Instructions: includeinclude, Flow control: if … then Flow control: try … thenthen Flow control: if … then Flow control: try … thenthe Example Scripts: CGI Scripts Example Scripts: Scriptsscript can Flow control: returnreturn a result of any type Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or optionally no result Operators: Make Identifier "@"at all. Flow control: if … then Flow control: if … thenIf the Functions with varying return types: call Instructions: callcaller Instructions: requirerequires a result Flow control: if … then Flow control: try … thenthen it will assume 0 Flow control: if … thenif Flow control: end Shell Immediate Commands: exit, quit, endend Flow control: returnreturns no result.
- Flow control: if … then
Flow control: if … thenIf the Example Scripts: CGI Scripts Example Scripts: Scriptsscript is a Glossary: text, text_valtext value which is executed with Functions with varying return types: eval Instructions: evaleval, Flow control: if … then Flow control: try … thenthen Flow control: if … then Flow control: try … thenthe Example Scripts: CGI Scripts Example Scripts: Scriptsscript can Flow control: returnreturn a result of any type Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or optionally no result Operators: Make Identifier "@"at all. Flow control: if … then Flow control: if … thenIf the Functions with varying return types: call Instructions: callcaller Instructions: requirerequires a result 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 Flow control: returnreturns no result, Flow control: if … then Flow control: try … thenthen an error is generated.
Flow control: if … thenif <condition>
<statements>
Flow control: if … then Flow control: try … thenthen
Flow control: if … thenif <condition>
<statements>
Flow control: if … then Flow control: try … thenelse
<statements>
Flow control: if … then Flow control: try … thenthen
Flow control: if … thenif <condition>
<statements>
Flow control: if … thenelif <condition>
<statements>
[ Flow control: if … thenelif <condition>
<statements> … ]
Flow control: if … then Flow control: try … thenelse
<statements>
Flow control: if … then Flow control: try … thenthen
Execute <statements> only Flow control: if … then Flow control: if … thenif the <condition> is true.
All Flow controlconditions must be a numeric Glossary: Valuevalues Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and are considered 'true' Flow control: if … thenif they are non-zero.
Flow control: if … then Flow control: if … thenIf the Flow controlcondition is true, Flow control: if … then Flow control: try … thenthen Flow control: if … then Flow control: try … thenthe Vipsi command syntax: Statements Glossary: Statementstatements in Flow control: if … then Flow control: try … thenthe following Flow controlbranch are executed 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 program finally jumps to Flow control: if … then Flow control: try … thenthe Flow control: if … then Flow control: try … thenthen Vipsi command syntax: Statements Glossary: Statementstatement, skipping all optionally present Flow control: if … thenelif Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and Flow control: if … then Flow control: try … thenelse Flow controlbranches.
Flow control: if … then Flow control: if … thenIf the Flow controlcondition is false, Flow control: if … then Flow control: try … thenthen List functions: thisthis Flow controlbranch is skipped, Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and all optionally present Flow control: if … thenelif Flow controlconditions are tested in order. Flow control: if … then Flow control: try … thenThe Flow controlbranch of Flow control: if … then Flow control: try … thenthe first Flow control: if … thenelif Flow controlcondition which is true is executed 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 program finally jumps to Flow control: if … then Flow control: try … thenthe Flow control: if … then Flow control: try … thenthen Vipsi command syntax: Statements Glossary: Statementstatement, skipping all other Flow control: if … thenelif Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and Flow control: if … then Flow control: try … thenelse Flow controlbranches.
Flow control: if … thenIf all Flow controlconditions fail, Flow control: if … then Flow control: try … thenthen Flow control: if … then Flow control: try … thenthe final Flow control: if … then Flow control: try … thenelse Flow controlbranch is executed, Flow control: if … thenif present. Flow control: if … thenIf no Flow control: if … then Flow control: try … thenelse Flow controlbranch is present, Flow control: if … then Flow control: try … thenthen actually no Vipsi command syntax: Statements Glossary: Statementstatements between Flow control: if … thenif 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 except for Flow control: if … then Flow control: try … thenthe Flow control: if … thenelif Vipsi command syntax: Instructions Instructions Glossary: Instructioninstructions are executed Operators: Make Identifier "@"at all.
e.g.
Flow control: if … thenif (a>b) Flow control: returnreturn a; Flow control: if … then Flow control: try … thenelse Flow control: returnreturn b; Flow control: if … then Flow control: try … thenthen;
Flow control: if … thenif a<0
Instructions: putput "a is smaller than zero"
Flow control: if … thenelif a==0
Instructions: putput "a is exactly zero"
Flow control: if … thenelif a>0
Instructions: putput "a is greater than zero"
Flow control: if … then Flow control: try … thenelse
Instructions: putput "you caught a NaN"
Flow control: if … then Flow control: try … thenthen
Flow control: returnreturn
Flow control: returnreturn <value>
Flow control: end Shell Immediate Commands: exit, quit, endEnd 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 optionally Flow control: returnreturn a result Glossary: Valuevalue.
Flow control: if … thenIf a Vipsi command syntax: Procedures Data Types: Procedures Glossary: Procedureprocedure Flow control: returnreturns a Glossary: Valuevalue, it should be called like a Vipsi command syntax: Functions Functions Glossary: Functionfunction. Flow control: if … then Flow control: try … thenThe result Glossary: Valuevalue may be any Data Types Invariants: Data typesdata type Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and of any size.
Flow control: if … thenIf a Vipsi command syntax: Procedures Data Types: Procedures Glossary: Procedureprocedure Flow control: returnreturns no Glossary: Valuevalue, it should be called 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 … thenIf Flow control: returnreturn is executed on 'ground level', that is, outside any Vipsi command syntax: Procedures Data Types: Procedures Glossary: Procedureprocedure, it Flow control: returnreturns from Flow control: if … then Flow control: try … thenthe current Example Scripts: CGI Scripts Example Scripts: Scriptsscript. Flow control: if … then Flow control: try … thenThen Flow control: returnreturn behaves just like Flow control: if … then Flow control: try … thenthe Vipsi command syntax: Instructions Instructions Glossary: Instructioninstruction Flow control: end Shell Immediate Commands: exit, quit, endend. Flow control: if … then Flow control: try … thenThe possible Shell Scripts: Return values Appendix: Return valuesreturn value depends on Flow control: if … then Flow control: try … thenthe invocation of Flow control: if … then Flow control: try … thenthe Example Scripts: CGI Scripts Example Scripts: Scriptsscript:
- Flow control: if … thenIf invoked from Flow control: if … then
Flow control: try … thenthe bash Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or similar, Flow control: if … then Flow control: try … thenthe Example Scripts: CGI Scripts Example Scripts: Scriptsscript Instructions: getgets called via Flow control: if … then Flow control: try … thenthe unix process forking mechanism. Flow control: if … then Flow control: try … thenThen you can Flow control: returnreturn only tiny little integers in range [0 to 255]. List functions: thisThis Shell Scripts: Return values Appendix: Return valuesreturn value is expected to be some kind of error code, Operators: Bitwise Not "~" Operators: Boolean Negation "!"not Flow control: if … then Flow control: try … thenthe "result" of Flow control: if … then Flow control: try … thenthe program. 0 typically means 'success' any other Glossary: Valuevalue indicates an error. Flow control: if … thenIf a Example Scripts: CGI Scripts Example Scripts: Scriptsscript Flow control: do … loopdoes Operators: Bitwise Not "~" Operators: Boolean Negation "!"not Flow control: returnreturn a result, that is, Flow control: if … thenif it executes Flow control: end Shell Immediate Commands: exit, quit, endend with no Vipsi command syntax: Arguments Glossary: Argumentsargument Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or runs beyond Flow control: if … then Flow control: try … thenthe Text functions: file Instructions: filefile 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 Shell Scripts: Return values Appendix: Return valuesreturn value is set to 0, which is likely to indicate 'no error'. Don't rely on Flow control: if … then Flow control: try … thenthe exact Glossary: Valuevalue of Flow control: if … then Flow control: try … thenthe Flow control: returnreturn code! Flow control: if … then Flow control: try … thenThe bash itself Flow control: returnreturns 126 Flow control: if … thenif a command was found but Operators: Bitwise Not "~" Operators: Boolean Negation "!"not executable, 127 Flow control: if … thenif a command was Operators: Bitwise Not "~" Operators: Boolean Negation "!"not found, 128+N Flow control: if … then Flow control: if … thenif the command crashed with exception N Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and possibly any other error code for other Flow controlconditions. In Operators: Add "+"addition vipsi Flow control: returnreturns 125 in Flow control: if … then Flow control: try … thenthe following cases: Flow control: if … then Flow control: if … thenif the Example Scripts: CGI Scripts Example Scripts: Scriptsscript crashes with an error Flow control: if … then Flow control: try … thenthen List functions: thisthis error code is returned Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or 125 Flow control: if … then Flow control: if … thenif the error code was too high. Flow control: if … then Flow control: if … thenIf the Example Scripts: CGI Scripts Example Scripts: Scriptsscript Flow control: returnreturns a non-numeric Glossary: Valuevalue Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or a numeric Glossary: Valuevalue out of range, Flow control: if … then Flow control: try … thenthen Flow control: if … then Flow control: try … thenthe result is substituted with 125 too.
- Flow control: if … thenIf invoked from another vip Example Scripts: CGI Scripts
Example Scripts: Scriptsscript Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or Flow control: if … then Flow control: try … thenthe vipsi command line using Text functions: sys Instructions: syssys Flow control: if … then Flow control: try … thenthen Flow control: if … then Flow control: try … thenthe Example Scripts: CGI Scripts Example Scripts: Scriptsscript Instructions: getgets called in Flow control: if … then Flow control: try … thenthe same way as from Flow control: if … then Flow control: try … thenthe bash shell. All said there is true here too, except for Flow control: if … then Flow control: try … thenthe additional result codes used by Flow control: if … then Flow control: try … thenthe bash. Flow control: if … then Flow control: try … thenThe Shell Scripts: Return values Appendix: Return valuesreturn value from Flow control: if … then Flow control: try … thenthe invoked Example Scripts: CGI Scripts Example Scripts: Scriptsscript is Operators: Bitwise Not "~" Operators: Boolean Negation "!"not returned to Flow control: if … then Flow control: try … thenthe Functions with varying return types: call Instructions: callcaller, Flow control: if … then Flow control: try … thenthe Functions with varying return types: call Instructions: callcaller Instructions: getgets Flow control: if … then Flow control: try … thenthe Example Scripts: CGI Scripts Example Scripts: Scriptsscript output to Constants: stdoutstdout instead. Flow control: if … thenIf an error in Flow control: if … then Flow control: try … thenthe Example Scripts: CGI Scripts Example Scripts: Scriptsscript occurs Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or Flow control: if … then Flow control: if … thenif the Example Scripts: CGI Scripts Example Scripts: Scriptsscript Flow control: returnreturns a non-zero Glossary: Valuevalue, Flow control: if … then Flow control: try … thenthen an error is triggered in Flow control: if … then Flow control: try … thenthe Functions with varying return types: call Instructions: callcaller Example Scripts: CGI Scripts Example Scripts: Scriptsscript which must be handled with Flow control: try … thentry. errorstr Flow control: if … then Flow control: try … thenthen contains some useful error message.
- Flow control: if … thenIf invoked from another vip Example Scripts: CGI Scripts
Example Scripts: Scriptsscript Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or Flow control: if … then Flow control: try … thenthe vipsi command line using Functions with varying return types: call Instructions: callcall Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or Functions with varying return types: include Instructions: includeinclude, Flow control: if … then Flow control: try … thenthen Flow control: if … then Flow control: try … thenthe Example Scripts: CGI Scripts Example Scripts: Scriptsscript can Flow control: returnreturn a result of any type Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or optionally no result Operators: Make Identifier "@"at all. Flow control: if … then Flow control: if … thenIf the Functions with varying return types: call Instructions: callcaller Instructions: requirerequires a result Flow control: if … then Flow control: try … thenthen it will assume 0 Flow control: if … thenif Flow control: end Shell Immediate Commands: exit, quit, endend Flow control: returnreturns no result.
- Flow control: if … then
Flow control: if … thenIf the Example Scripts: CGI Scripts Example Scripts: Scriptsscript is a Glossary: text, text_valtext value which is executed with Functions with varying return types: eval Instructions: evaleval, Flow control: if … then Flow control: try … thenthen Flow control: if … then Flow control: try … thenthe Example Scripts: CGI Scripts Example Scripts: Scriptsscript can Flow control: returnreturn a result of any type Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or optionally no result Operators: Make Identifier "@"at all. Flow control: if … then Flow control: if … thenIf the Functions with varying return types: call Instructions: callcaller Instructions: requirerequires a result 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 Flow control: returnreturns no result, Flow control: if … then Flow control: try … thenthen an error is generated.
e.g.:
Instructions: procproc Geomed(a,b) { Flow control: returnreturn Numeric functions: sqrtsqrt(a*b); }
Instructions: procproc Check(t) { Flow control: if … thenif Numeric functions: istextistext(t) Flow control: returnreturn; Flow control: if … then Flow control: try … thenelse Instructions: putput "no Data Types: Text Item selector "[]": Text Glossary: text, text_valtext:",t; Flow control: if … then Flow control: try … thenthen }
Flow control: try … thentry
<statements>
Flow control: if … then Flow control: try … thenthen
Flow control: try … thentry
<statements>
Flow control: if … then Flow control: try … thenelse
<statements>
Flow control: if … then Flow control: try … thenthen
Execute Vipsi command syntax: Statements Glossary: Statementstatements with a "safety net".
Flow control: if … thenIf a runtime error occurs, Flow control: if … then Flow control: try … thenthen Flow control: if … then Flow control: try … thenthe program is Operators: Bitwise Not "~" Operators: Boolean Negation "!"not aborted with an error message. Instead Flow control: if … then Flow control: try … thenthe program execution resumes after Flow control: if … then Flow control: try … thenthen Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or, Flow control: if … thenif present, Operators: Make Identifier "@"at your error handler after Flow control: if … then Flow control: try … thenelse.
In case of an error Flow control: if … then Flow control: try … thenthe Glossary: Variable, var_refvariable errorstr is created (Flow control: if … thenif it Operators: Bitwise Not "~" Operators: Boolean Negation "!"not already Numeric functions: existsexists) Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and contains Flow control: if … then Flow control: try … thenthe error message.
Your error handler Instructions: getgets also called Flow control: if … then Flow control: if … thenif the error occurs deep inside some nested Vipsi command syntax: Procedures Data Types: Procedures Glossary: Procedureprocedure Functions with varying return types: call Instructions: callcall, Flow control: if … thenif no other error handler catches it before you.
e.g.:
Flow control: try … thentry
Instructions: openinopenin #4, "that damn ol' Text functions: file Instructions: filefile"
Flow control: if … then Flow control: try … thenelse
Numeric functions: log Numeric functions: loge Instructions: loglog "failed: ", errorstr, Constants: nlnl
Flow control: if … then Flow control: try … thenthen
|