vipsi - the friendly vip script interpreter

Example Scripts

Easy Example Scripts

Factorial "!"

List functions: thisThis Example Scripts: CGI Scripts
Example Scripts: Scripts
script
calculates Flow control: if … then
Flow control: try … then
the
Easy Example Scripts: Factorial "!"factorial n! of Flow control: if … then
Flow control: try … then
the
passed Vipsi command syntax: Arguments
Glossary: Arguments
argument
n.

List functions: thisThis is an easy example for a Example Scripts: CGI Scripts
Example Scripts: Scripts
script
, which can be called in two different ways:

  1. as shell command
  2. Operators: Boolean Or with Variable "||="
    Operators: Bitwise Or with Variable "|="
    Operators: Bitwise Or "|"
    Operators: Boolean Or "||"
    or
    called from another vip Example Scripts: CGI Scripts
    Example Scripts: Scripts
    script
    .

Flow control: if … thenIf invocated in Flow control: if … then
Flow control: try … then
the
traditional way, either from Flow control: if … then
Flow control: try … then
the
bash shell Operators: Boolean Or with Variable "||="
Operators: Bitwise Or with Variable "|="
Operators: Bitwise Or "|"
Operators: Boolean Or "||"
or
from a vip Example Scripts: CGI Scripts
Example Scripts: Scripts
script
with Vipsi command syntax: Functions
Functions
Glossary: Function
function
Text functions: sys
Instructions: sys
sys
(), Flow control: if … then
Flow control: try … then
then
Flow control: if … then
Flow control: try … then
the
passed Vipsi command syntax: Arguments
Glossary: Arguments
argument
is a Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
text
. No chance for anything Flow control: if … then
Flow control: try … then
else
. So we Text functions: convert
Instructions: convert
convert
Flow control: if … then
Flow control: try … then
the
Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
text
to a Glossary: number, num_valnumber Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
and
... hm, print Flow control: if … then
Flow control: try … then
the
result to Constants: stdoutstdout. No other way Flow control: if … then
Flow control: try … then
else
.

Flow control: if … thenIf invovated from another vip Example Scripts: CGI Scripts
Example Scripts: Scripts
script
Operators: Boolean Or with Variable "||="
Operators: Bitwise Or with Variable "|="
Operators: Bitwise Or "|"
Operators: Boolean Or "||"
or
from Flow control: if … then
Flow control: try … then
the
vipsi shell with Functions with varying return types: call
Instructions: call
call
(), Flow control: if … then
Flow control: try … then
then
we can pass Vipsi command syntax: Arguments
Glossary: Arguments
arguments
of any type Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
and
can Flow control: returnreturn a Glossary: Valuevalue of any type. So, Flow control: if … thenif we detect a numeric Vipsi command syntax: Arguments
Glossary: Arguments
argument
, we Flow control: do … loopdo it just like List functions: thisthis.

Download link

fak.vs

Listing

#!/usr/local/bin/vipsi

/*
    Example Scriptsexample script for Text functions: sys
Instructions: sys
sys
() Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
and
Functions with varying return types: call
Instructions: call
call
() Flow control: if … thenif called with «Functions with varying return types: call
Instructions: call
call
("fak.vs",Glossary: number, num_valnumber)» it Flow control: returnreturns a numeric Glossary: Valuevalue Flow control: if … thenif called with «Text functions: sys
Instructions: sys
sys
("fak.vs",numberstring)» it prints Flow control: if … then
Flow control: try … then
the
result both cases are distinguished by examining Flow control: if … then
Flow control: try … then
the
type of Flow control: if … then
Flow control: try … then
the
passed Vipsi command syntax: Arguments
Glossary: Arguments
argument
: Flow control: if … thenif it is numeric Flow control: if … then
Flow control: try … then
then
it must be Functions with varying return types: call
Instructions: call
call
() Flow control: if … thenif it is a text Flow control: if … then
Flow control: try … then
then
we assume it was Text functions: sys
Instructions: sys
sys
() */ Flow control: if … thenif Numeric functions: countcount List functions: globals
Shell Immediate Commands: globals
globals
!= 1 Numeric functions: log
Numeric functions: loge
Instructions: log
log
"error: Example Scripts: CGI Scripts
Example Scripts: Scripts
script
'fak.vs' takes exactly one Vipsi command syntax: Arguments
Glossary: Arguments
argument
",Constants: nlnl Instructions: var
How does VScript::Value() work?: Var*&
var
i = 1 Flow control: do … loopdo Flow control: whilewhile i<Numeric functions: countcount List functions: globals
Shell Immediate Commands: globals
globals
Numeric functions: log
Numeric functions: loge
Instructions: log
log
"arg[",i,"] = ",List functions: globals
Shell Immediate Commands: globals
globals
[i],Constants: nlnl i++ Flow control: do … looploop Flow control: end
Shell Immediate Commands: exit, quit, end
end
1 Flow control: if … then
Flow control: try … then
then
Instructions: renamerename List functions: globals
Shell Immediate Commands: globals
globals
[1] = "n" Instructions: var
How does VScript::Value() work?: Var*&
var
is_num = Numeric functions: isnumberisnumber(n) Instructions: var
How does VScript::Value() work?: Var*&
var
is_text = Numeric functions: istextistext(n) Flow control: if … thenif is_text n=Functions with varying return types: eval
Instructions: eval
eval
(n) Flow control: if … then
Flow control: try … then
then
Instructions: var
How does VScript::Value() work?: Var*&
var
result = 1; Flow control: if … thenif (!is_num && !is_text) Numeric functions: log
Numeric functions: loge
Instructions: log
log
"error: Example Scripts: CGI Scripts
Example Scripts: Scripts
script
'fak.vs' Instructions: requirerequires a numeric Operators: Boolean Or with Variable "||="
Operators: Bitwise Or with Variable "|="
Operators: Bitwise Or "|"
Operators: Boolean Or "||"
or
Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
text
Vipsi command syntax: Arguments
Glossary: Arguments
argument
",Constants: nlnl Flow control: end
Shell Immediate Commands: exit, quit, end
end
1 Flow control: if … then
Flow control: try … then
then
Flow control: do … loopdo Flow control: whilewhile n>1 result *= n-- Flow control: do … looploop Flow control: if … thenif (is_num) // Flow control: if … thenif called with "Functions with varying return types: call
Instructions: call
call
" Flow control: returnreturn result // Flow control: if … then
Flow control: try … then
then
we can Flow control: returnreturn real data Flow control: if … then
Flow control: try … then
else
Instructions: putput result,Constants: nlnl // Flow control: if … thenif called with "Text functions: sys
Instructions: sys
sys
" Flow control: end
Shell Immediate Commands: exit, quit, end
end
0 // we can only print to Constants: stdoutstdout Flow control: if … then
Flow control: try … then
then
// Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
and
Flow control: returnreturn "ok"

Prime Factor Factorizing

Of course an interpreter language is Operators: Bitwise Not "~"
Operators: Boolean Negation "!"
not
suitable for Glossary: number, num_valnumber crunching, but for testing an algorithm it is Shell Immediate Commands: exit, quit, endquite conveniant.

When i worked on factorizing of large Data Types: Numbersnumbers i Instructions: writewrite List functions: thisthis Example Scripts: CGI Scripts
Example Scripts: Scripts
script
to test Flow control: if … then
Flow control: try … then
the
first thoughts. You can just Functions with varying return types: call
Instructions: call
call
it w/o parameters to run a test on a automatically generated Glossary: number, num_valnumber, which is secretly calculated by multiplying two primes of Flow control: if … then
Flow control: try … then
the
preset size, Operators: Boolean Or with Variable "||="
Operators: Bitwise Or with Variable "|="
Operators: Bitwise Or "|"
Operators: Boolean Or "||"
or
supply Glossary: Valuevalues for Flow control: if … then
Flow control: try … then
the
Glossary: number, num_valnumber of test Flow control: do … looploops, size of prime A, size of prime factor B Operators: Boolean Or with Variable "||="
Operators: Bitwise Or with Variable "|="
Operators: Bitwise Or "|"
Operators: Boolean Or "||"
or
pass an own Glossary: number, num_valnumber to factorize.

Operators: Bitwise Not "~"
Operators: Boolean Negation "!"
note
: accuracy of 8 byte float arithmetic is 53 bits. You'll Numeric functions: findfind List functions: thisthis Glossary: number, num_valnumber in Flow control: if … then
Flow control: try … then
the
Online Chat: Listings
Search Site: Listing
Print Environment: Listing
Online Z80 Assembler: Listing
Show Beautified Folder Listings: Listing
Sort-of-a Shell: Listing
Factorial "!": Listing
Prime Factor Factorizing: Listing
Speedometer: Listing
VIP Script Test Suite: Listing
listing
.

Vipsi command syntax: CommentsComments in Flow control: if … then
Flow control: try … then
the
Example Scripts: CGI Scripts
Example Scripts: Scripts
script
are German.

Download link

prime.vs

Listing

#!/usr/local/bin/vipsi


Instructions: var
How does VScript::Value() work?: Var*&
var
argc; argc = Numeric functions: countcount List functions: globals
Shell Immediate Commands: globals
globals
-1 Instructions: var
How does VScript::Value() work?: Var*&
var
testloops = 1 Instructions: var
How does VScript::Value() work?: Var*&
var
quiet = 0 Instructions: var
How does VScript::Value() work?: Var*&
var
testzahl = 0 Instructions: var
How does VScript::Value() work?: Var*&
var
bits_a = 15 // a<b Instructions: var
How does VScript::Value() work?: Var*&
var
bits_b = 25 // und a+b <= 53 Instructions: var
How does VScript::Value() work?: Var*&
var
i=0 Flow control: do … loopdo Flow control: whilewhile++i<=argc Instructions: var
How does VScript::Value() work?: Var*&
var
arg = List functions: globals
Shell Immediate Commands: globals
globals
[i] Flow control: if … thenif arg=="-h" || arg=="--help" Instructions: var
How does VScript::Value() work?: Var*&
var
msg = « Zerlege Testzahl in zwei (Prim-)faktoren Erzeugt entweder eine Testzahl aus zwei generierten Testzahlen oder zerlegt die übergebene Testzahl in 2 Faktoren. -q --quiet Ohne Zwischenmeldungen -n <zahl> --Flow control: do … looploops Anzahl Testläufe (dflt: 1) -a <bits> --bits_a Größenordnung für erste Primzahl: 2..51 -b <bits> --bits_b Größenordnung für zweite Primzahl: 2..51 <zahl> Eigene statt generierter Testzahl » Text functions: convert
Instructions: convert
convert
msg from tab4 Instructions: putput msg Flow control: end
Shell Immediate Commands: exit, quit, end
end
0 Flow control: if … then
Flow control: try … then
then
Flow control: if … thenif arg=="-q" || arg=="--quiet" quiet=1 Flow control: nextnext Flow control: if … then
Flow control: try … then
then
Flow control: if … thenif arg=="-n" || arg=="--tests" || arg=="--Flow control: do … looploops" Flow control: if … thenif ++i>argc Flow control: nextnext Flow control: if … then
Flow control: try … then
then
testloops=List functions: globals
Shell Immediate Commands: globals
globals
[i] Flow control: if … thenif !Numeric functions: isnumberisnumber testloops Flow control: try … thentry testloops=Functions with varying return types: eval
Instructions: eval
eval
testloops Flow control: if … then
Flow control: try … then
else
testloops=1 Flow control: if … then
Flow control: try … then
then
Flow control: if … then
Flow control: try … then
then
Flow control: nextnext Flow control: if … then
Flow control: try … then
then
Flow control: if … thenif arg=="-a" || arg=="--bits_a" Flow control: if … thenif ++i>argc Flow control: nextnext Flow control: if … then
Flow control: try … then
then
arg=List functions: globals
Shell Immediate Commands: globals
globals
[i] Flow control: if … thenif !Numeric functions: isnumberisnumber arg Flow control: try … thentry arg=Functions with varying return types: eval
Instructions: eval
eval
arg bits_a=arg Flow control: if … then
Flow control: try … then
then
Flow control: if … then
Flow control: try … then
else
bits_a=arg Flow control: if … then
Flow control: try … then
then
Flow control: if … thenif bits_a<2||bits_a>51 bits_a=40-bits_b Flow control: if … then
Flow control: try … then
then
Flow control: if … thenif bits_a>bits_b { Instructions: var
How does VScript::Value() work?: Var*&
var
z=bits_a bits_a=bits_b bits_b=z } Flow control: if … then
Flow control: try … then
then
Flow control: nextnext Flow control: if … then
Flow control: try … then
then
Flow control: if … thenif arg=="-b" || arg=="--bits_b" Flow control: if … thenif ++i>argc Flow control: nextnext Flow control: if … then
Flow control: try … then
then
arg=List functions: globals
Shell Immediate Commands: globals
globals
[i] Flow control: if … thenif !Numeric functions: isnumberisnumber arg Flow control: try … thentry arg=Functions with varying return types: eval
Instructions: eval
eval
arg bits_b=arg Flow control: if … then
Flow control: try … then
then
Flow control: if … then
Flow control: try … then
else
bits_b=arg Flow control: if … then
Flow control: try … then
then
Flow control: if … thenif bits_b<2||bits_b>51 bits_b=40-bits_a Flow control: if … then
Flow control: try … then
then
Flow control: if … thenif bits_a>bits_b { Instructions: var
How does VScript::Value() work?: Var*&
var
z=bits_a bits_a=bits_b bits_b=z } Flow control: if … then
Flow control: try … then
then
Flow control: nextnext Flow control: if … then
Flow control: try … then
then
Flow control: if … thenif testloops!=1 || testzahl!=0 Instructions: putput Constants: nlnl,"Unerwartete Testzahl wird ignoriert." Flow control: nextnext Flow control: if … then
Flow control: try … then
then
Flow control: try … thentry testzahl = arg Flow control: if … thenif !Numeric functions: isnumberisnumber testzahl testzahl = Functions with varying return types: eval
Instructions: eval
eval
testzahl Flow control: if … then
Flow control: try … then
then
Instructions: var
How does VScript::Value() work?: Var*&
var
z = testloops testloops = 0 Flow control: if … thenif testzahl<3 || Numeric functions: fractfract(testzahl>>1)!=0.5 || testzahl+1==testzahl || testzahl-1==testzahl Instructions: putput Constants: nlnl,"Testzahl außerhalb der Rechengenauigkeit.", Constants: nlnl,"Starte ersatzweise Test.", Constants: nlnl testloops = z testzahl = 0 Flow control: if … then
Flow control: try … then
then
Flow control: if … then
Flow control: try … then
else
Instructions: putput Constants: nlnl,"Parameter war nicht numerisch.", Constants: nlnl,"Starte ersatzweise Test.", Constants: nlnl testloops = z testzahl = 0 Flow control: if … then
Flow control: try … then
then
Flow control: do … looploop /* ==== TOOLS =================================================== */ Instructions: procproc NewPrime(bits) { Flow control: do … loopdo Instructions: var
How does VScript::Value() work?: Var*&
var
n = (0.5+Numeric functions: randomrandom(0.5)) << bits n = Numeric functions: intint(n>>1) << 1 +1 Instructions: var
How does VScript::Value() work?: Var*&
var
e = Numeric functions: intint Numeric functions: sqrtsqrt n Instructions: var
How does VScript::Value() work?: Var*&
var
q = 1 Flow control: do … loopdo Flow control: if … thenif (q+=2)>e Flow control: returnreturn n Flow control: if … then
Flow control: try … then
then
Flow control: untiluntil Numeric functions: fractfract(n/q)==0 Flow control: do … looploop Flow control: do … looploop } Instructions: procproc PrüfeRechengenauigkeit( prime_a, prime_b ) { Instructions: var
How does VScript::Value() work?: Var*&
var
n = prime_a * prime_b Flow control: if … thenif n / prime_a != prime_b Flow control: returnreturn "failed (1)" Flow control: if … then
Flow control: try … then
then
Flow control: if … thenif n / prime_b != prime_a Flow control: returnreturn "failed (1a)" Flow control: if … then
Flow control: try … then
then
Flow control: if … thenif n-1+1 != n Flow control: returnreturn "failed (2)" Flow control: if … then
Flow control: try … then
then
Flow control: if … thenif n-1 == n Flow control: returnreturn "failed (2a)" Flow control: if … then
Flow control: try … then
then
Flow control: if … thenif n+1 == n Flow control: returnreturn "failed (2b)" Flow control: if … then
Flow control: try … then
then
Instructions: var
How does VScript::Value() work?: Var*&
var
a0 = Numeric functions: intint(Numeric functions: sqrtsqrt(n)) Instructions: var
How does VScript::Value() work?: Var*&
var
da = 2 a0 -= Numeric functions: fractfract(a0>>1)==0 Instructions: var
How does VScript::Value() work?: Var*&
var
b0 = Numeric functions: intint(n/a0) Instructions: var
How does VScript::Value() work?: Var*&
var
db = 2 b0 -= Numeric functions: fractfract(b0>>1)==0 Instructions: var
How does VScript::Value() work?: Var*&
var
r0 = n - a0 * b0 Instructions: var
How does VScript::Value() work?: Var*&
var
z0 = 2*(b0-a0+da) Instructions: var
How does VScript::Value() work?: Var*&
var
dz = 2*(da+db) Flow control: if … thenif a0*b0+r0 != n Flow control: returnreturn "failed (3)" Flow control: if … then
Flow control: try … then
then
Flow control: returnreturn "ok" } Instructions: procproc PrüfeAlgorithmus ( prime_a, prime_b ) { Instructions: var
How does VScript::Value() work?: Var*&
var
n = prime_a * prime_b Instructions: var
How does VScript::Value() work?: Var*&
var
a0 = Numeric functions: intint(Numeric functions: sqrtsqrt(n)) Instructions: var
How does VScript::Value() work?: Var*&
var
da = 2 a0 -= Numeric functions: fractfract(a0>>1)==0 Instructions: var
How does VScript::Value() work?: Var*&
var
b0 = Numeric functions: intint(n/a0) Instructions: var
How does VScript::Value() work?: Var*&
var
db = 2 b0 -= Numeric functions: fractfract(b0>>1)==0 Instructions: var
How does VScript::Value() work?: Var*&
var
r0 = n - a0 * b0 Instructions: var
How does VScript::Value() work?: Var*&
var
z0 = 2*(b0-a0+da) Instructions: var
How does VScript::Value() work?: Var*&
var
dz = 2*(da+db) Instructions: var
How does VScript::Value() work?: Var*&
var
a = a0-da Instructions: var
How does VScript::Value() work?: Var*&
var
b = b0+db Instructions: var
How does VScript::Value() work?: Var*&
var
r = r0+z0 Instructions: var
How does VScript::Value() work?: Var*&
var
z = z0+dz Flow control: if … thenif a*b+r != n Flow control: returnreturn "failed (4)" Flow control: if … then
Flow control: try … then
then
a-=da b+=db r+=z z+=dz Flow control: if … thenif a*b+r != n Flow control: returnreturn "failed (5)" Flow control: if … then
Flow control: try … then
then
a-=da b+=db r+=z z+=dz Flow control: if … thenif a*b+r != n Flow control: returnreturn "failed (6)" Flow control: if … then
Flow control: try … then
then
Flow control: returnreturn "ok" } /* ========================================================== a_prime * b_prime = n a * b + r = n a < b, a--, b++ a' = a-da; da = 2 b' = b+db; db = 2; wird erhöht, wenn dr>=2*a r = n -a*b r' = n -a'*b' = n-(a-da)*(b+db) = n -a*b -a*db +b*da +da*db = r -a*db +b*da +da*db dr = r' - r = r -a*db +b*da +da*db -r = -a*db +b*da +da*db r" = n -a"*b" = n-(a-2da)*(b+2db) = n -a*b -2*a*db +2*b*da +4*da*db = r' -a*db +b*da +3*da*db dr' = r" - r' = r' -a*db +b*da +3*da*db -r' = -a*db +b*da +3*da*db = dr +2*da*db ddr = dr' - dr = dr +2*da*db - dr = 2*da*db Zur Steigung db/da: b = f(a) = n/a = n * a⁻¹ db/da = f'(a) = n/a² = n * a⁻² db muss auf 4 erhöht werden, bei: f'(a) = n/a² = 4/2 <=> n = 2*a² a = Numeric functions: sqrtsqrt(n/2) a = Numeric functions: sqrtsqrt(n) / Numeric functions: sqrtsqrt(2) wobei Numeric functions: sqrtsqrt(n) ja der startwert für a ist. allgemein: db muss immer auf das nächste db erhöht werden bei a = Numeric functions: sqrtsqrt(n) / Numeric functions: sqrtsqrt(db/da) bei a = Numeric functions: sqrtsqrt(n)/2 wird db/da also gerade auf 8/2 erhöht. Dann ist der halbe Wertebereich für a abgearbeitet! Wann muss db zum ersten Mal um mehr als 2 (also 4) erhöht werden? wenn dr' = dr+ddr >= 4*a Wann muss b zum ersten Mal um mehr als 2 (also 4) zusätzlich gesteppt werden? wenn r' = r+dr >= 4*a */ Instructions: procproc FindPrimes(n) { Instructions: var
How does VScript::Value() work?: Var*&
var
a = Numeric functions: intint(Numeric functions: sqrtsqrt(n)) a -= Numeric functions: fractfract(a>>1)==0 Instructions: var
How does VScript::Value() work?: Var*&
var
b = Numeric functions: intint(n/a) b -= Numeric functions: fractfract(b>>1)==0 Instructions: var
How does VScript::Value() work?: Var*&
var
r = n - a * b Instructions: var
How does VScript::Value() work?: Var*&
var
da = 2 Instructions: var
How does VScript::Value() work?: Var*&
var
db = 2 Instructions: var
How does VScript::Value() work?: Var*&
var
dr = -a*db +b*da +da*db Instructions: var
How does VScript::Value() work?: Var*&
var
ddr = 2*da*db Instructions: var
How does VScript::Value() work?: Var*&
var
f Flow control: if … thenif r==0 Flow control: returnreturn List functions: localslocals Flow control: if … then
Flow control: try … then
then
Flow control: do … loopdo // Flow control: whilewhile a*b+r == n // check Flow control: if … thenif r>=2*a Flow control: if … thenif dr>=2*a f = Numeric functions: intint(dr/(2*a))*2 // Flow control: if … thenif (f>2) Numeric functions: log
Numeric functions: loge
Instructions: log
log
" dr/2a=",f," " Flow control: if … then
Flow control: try … then
then
db += f dr -= (a-da)*f //Flow control: if … thenif(dr!=-a*db +b*da +da*db) Numeric functions: log
Numeric functions: loge
Instructions: log
log
" (1)" Flow control: exit
Shell Immediate Commands: exit, quit, end
exit
Flow control: if … then
Flow control: try … then
then
ddr += f*2*da //Flow control: if … thenif(ddr!=2*da*db) Numeric functions: log
Numeric functions: loge
Instructions: log
log
" (2)" Flow control: exit
Shell Immediate Commands: exit, quit, end
exit
Flow control: if … then
Flow control: try … then
then
// Instructions: putput Constants: nlnl, List functions: localslocals, " db incremented" Flow control: if … thenif r>=4*a f = Numeric functions: intint(r/(2*a))*2 b += f r -= f*a //Flow control: if … thenif(r!=n-a*b) Numeric functions: log
Numeric functions: loge
Instructions: log
log
"(3)" Flow control: end
Shell Immediate Commands: exit, quit, end
end
Flow control: if … then
Flow control: try … then
then
dr += f*2 //Flow control: if … thenif(dr!=-a*db +b*da +da*db) Numeric functions: log
Numeric functions: loge
Instructions: log
log
"(4)" Flow control: end
Shell Immediate Commands: exit, quit, end
end
Flow control: if … then
Flow control: try … then
then
Flow control: untiluntil r==0 // found ((Flow control: if … thenif n was prime Flow control: if … then
Flow control: try … then
then
List functions: thisthis triggers when a==1)) Flow control: nextnext Flow control: if … then
Flow control: try … then
then
Flow control: if … then
Flow control: try … then
then
f = Numeric functions: intint(r/(2*a))*2 Flow control: if … thenif (f>2) Numeric functions: log
Numeric functions: loge
Instructions: log
log
" r/2a=",f," " Flow control: if … then
Flow control: try … then
then
b += f r -= f*a //Flow control: if … thenif(r!=n-a*b) Numeric functions: log
Numeric functions: loge
Instructions: log
log
"(5)" Flow control: end
Shell Immediate Commands: exit, quit, end
end
Flow control: if … then
Flow control: try … then
then
dr += f*2 //Flow control: if … thenif(dr!=-a*db +b*da +da*db) Numeric functions: log
Numeric functions: loge
Instructions: log
log
"(6)" Flow control: end
Shell Immediate Commands: exit, quit, end
end
Flow control: if … then
Flow control: try … then
then
Flow control: untiluntil r==0 // found ((Flow control: if … thenif n was prime Flow control: if … then
Flow control: try … then
then
List functions: thisthis triggers when a==1)) // Flow control: untiluntil a<2 // no prime factor found! ((no need: a==1 is always found)) // Flow control: whilewhile a*b+r == n // check Flow control: if … then
Flow control: try … then
then
a-=da b+=db r+=dr dr+=ddr Flow control: do … looploop Flow control: returnreturn List functions: localslocals } Instructions: procproc ZerlegeZahl ( n ) { Flow control: if … thenif !quiet Instructions: putput Constants: nlnl, "---- start ----" Flow control: if … then
Flow control: try … then
then
Instructions: var
How does VScript::Value() work?: Var*&
var
zeit = Numeric functions: nownow Instructions: var
How does VScript::Value() work?: Var*&
var
r = FindPrimes(n) zeit = now-zeit Flow control: if … thenif quiet Instructions: putput Constants: nlnl, n, " = ", r.a, " * ", r.b, " + ", r.r Flow control: if … then
Flow control: try … then
else
Instructions: putput Constants: nlnl, n, " = ", r.a, " * ", r.b, " + ", r.r Instructions: putput Constants: nlnl,"Zeit = ", Numeric functions: intint(zeit*1000)/1000 Instructions: putput Constants: nlnl,"Tests/s = ", Numeric functions: intint((Numeric functions: intint(Numeric functions: sqrtsqrt(n))-r.a+2)/2/zeit+0.5) Instructions: putput Constants: nlnl,"--- finished ----",Constants: nlnl Flow control: if … then
Flow control: try … then
then
} Instructions: procproc RunTest ( prime_a, prime_b ) { Flow control: if … thenif !quiet Instructions: putput Constants: nlnl, "---- start ----" Flow control: if … then
Flow control: try … then
then
Instructions: var
How does VScript::Value() work?: Var*&
var
n = prime_a*prime_b Instructions: var
How does VScript::Value() work?: Var*&
var
zeit = Numeric functions: nownow Instructions: var
How does VScript::Value() work?: Var*&
var
r = FindPrimes(n) zeit = now-zeit Flow control: if … thenif quiet Instructions: putput Constants: nlnl, n, " = ", r.a, " * ", r.b, " + ", r.r Flow control: if … then
Flow control: try … then
else
Instructions: putput Constants: nlnl,"faktor a = ", r.a, {" (ok)"," ("#prime_a #")"}[1+(r.a!=prime_a)] Instructions: putput Constants: nlnl,"faktor b = ", r.b, {" (ok)"," ("#prime_b #")"}[1+(r.b!=prime_b)] Instructions: putput Constants: nlnl,"rest r = ", r.r, {" (ok)"," ("#n-r.a*r.b#")"}[1+(r.r!=n-r.a*r.b)] Instructions: putput Constants: nlnl,"produkt = ", r.a*r.b, {" (ok)"," ("#n #")"}[1+(r.a*r.b!=n)] Instructions: putput Constants: nlnl,"Zeit = ", Numeric functions: intint(zeit*1000)/1000 Instructions: putput Constants: nlnl,"Tests/s = ", Numeric functions: intint((Numeric functions: intint(Numeric functions: sqrtsqrt(n))-r.a+2)/2/zeit+0.5) Instructions: putput Constants: nlnl,"--- finished ----",Constants: nlnl Flow control: if … then
Flow control: try … then
then
} Flow control: if … thenif !quiet Instructions: putput Constants: nlnl, "Primzahlzerlegung" Flow control: if … then
Flow control: try … then
then
Flow control: if … thenif testloops==0 ZerlegeZahl(testzahl); Flow control: end
Shell Immediate Commands: exit, quit, end
end
0 Flow control: if … then
Flow control: try … then
then
Flow control: do … loopdo Flow control: whilewhile testloops-- Flow control: do … loopdo // erzeuge zwei Primzahlen Instructions: var
How does VScript::Value() work?: Var*&
var
prime_a = NewPrime( bits_a ) Instructions: var
How does VScript::Value() work?: Var*&
var
prime_b = NewPrime( bits_b ) Flow control: untiluntil prime_a < prime_b Flow control: do … looploop Flow control: if … thenif !quiet Instructions: var
How does VScript::Value() work?: Var*&
var
n = prime_a * prime_b Instructions: putput Constants: nlnl, "Prime a = ",prime_a, " (", Numeric functions: intint(Numeric functions: log2log2(prime_a+1))+1, " Bit)" Instructions: putput Constants: nlnl, "Prime b = ",prime_b, " (", Numeric functions: intint(Numeric functions: log2log2(prime_b+1))+1, " Bit)" Instructions: putput Constants: nlnl, "Produkt n = ",n, " (", Numeric functions: intint(Numeric functions: log2log2(n+1))+1, " Bit)" Instructions: putput Constants: nlnl, "Wurzel n = ",Numeric functions: sqrtsqrt n Instructions: putput Constants: nlnl, "Faktor b/a = ",Numeric functions: intint(prime_b/prime_a*100)/100 Instructions: putput Constants: nlnl, "Prüfe Rechengenauigkeit ... " Instructions: var
How does VScript::Value() work?: Var*&
var
t1 = PrüfeRechengenauigkeit(prime_a,prime_b) Instructions: putput t1 Instructions: putput Constants: nlnl, "Prüfe Algorithmus ... " Instructions: var
How does VScript::Value() work?: Var*&
var
t2 = PrüfeAlgorithmus(prime_a,prime_b) Instructions: putput t2 Flow control: if … thenif t1#t2 != "okok" Flow control: end
Shell Immediate Commands: exit, quit, end
end
1 Flow control: if … then
Flow control: try … then
then
Flow control: if … then
Flow control: try … then
then
RunTest(prime_a,prime_b); Flow control: do … looploop Flow control: end
Shell Immediate Commands: exit, quit, end
end

Speedometer

List functions: thisThis is a simple Appendix: Speedspeed test i wrote in Flow control: if … then
Flow control: try … then
the
early days of vipsi. It Flow control: do … loopdoes some fancy stuff Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
and
Numeric functions: countcounts, how often it can Flow control: do … loopdo it in 10 seconds. Flow control: if … then
Flow control: try … then
Then
Flow control: if … then
Flow control: try … then
the
result is normalized to a Glossary: Valuevalue i got Flow control: if … then
Flow control: try … then
then
on my P4@2.53GHz. That result i called one megaboogie.

I ran it right Numeric functions: nownow again Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
and
i got 0.86 megaboogies. Hm, either a donkey sucks Flow control: if … then
Flow control: try … then
the
water from my water cooling, Operators: Boolean Or with Variable "||="
Operators: Bitwise Or with Variable "|="
Operators: Bitwise Or "|"
Operators: Boolean Or "||"
or
some added error checkings slow it down. Operators: Boolean Or with Variable "||="
Operators: Bitwise Or with Variable "|="
Operators: Bitwise Or "|"
Operators: Boolean Or "||"
Or
, dare Operators: Bitwise Not "~"
Operators: Boolean Negation "!"
not
believe it, it's got slower since.

Flow control: if … thenIf you think that 710 Flow control: do … looploops in 10 seconds, which i obviously achieved on my P4, are poor: ok, it's Operators: Bitwise Not "~"
Operators: Boolean Negation "!"
not
dread fast. But Flow control: if … then
Flow control: try … then
the
Flow control: do … looploop also contains a Functions with varying return types: call
Instructions: call
call
to fak(100), that means a 100 times recursive Functions with varying return types: call
Instructions: call
calls
to Flow control: if … then
Flow control: try … then
the
Easy Example Scripts: Factorial "!"factorial Instructions: procproc, Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
and
it's doing some heavy Data Types: Lists and arrays
Item selector "[]": Lists
Glossary: list, list_val
list
operations. Operators: Bitwise Not "~"
Operators: Boolean Negation "!"
Not
that bad.

Update: With version 0.8.8 introduced Glossary: Variable, var_refvariable Vipsi command syntax: Identifiers (names)
Identifiers, names
Operators: Make Identifier "@"
Text functions: name
Glossary: Name, Identifier
name
hashing my P4 runs Operators: Make Identifier "@"at 1.70 megaboogies. Impressive Appendix: Speedspeed bump. B-)

Just take a look Operators: Make Identifier "@"at Flow control: if … then
Flow control: try … then
the
source to Instructions: getget a feeling for Flow control: if … then
Flow control: try … then
the
vip Example Scripts: CGI Scripts
Example Scripts: Scripts
script
language.

Download link

speedometer.vs

Listing

#!/usr/local/bin/vipsi


// Appendix: Speedspeed test
// calibrated to yield approx. 1.00 on my P4




Instructions: putput Constants: nlnl, "hi, i'm vipsi!"
Instructions: putput Constants: nlnl, "Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
and
i'm incredibly fast! ..." Instructions: waitwait 1 Instructions: putput Constants: nlnl Instructions: putput Constants: nlnl, "let's make Flow control: if … then
Flow control: try … then
the
test." Instructions: putput Constants: nlnl, "calculating... " Instructions: deldel * Instructions: var
How does VScript::Value() work?: Var*&
var
ta = Numeric functions: nownow Instructions: var
How does VScript::Value() work?: Var*&
var
dt = 10 Instructions: var
How does VScript::Value() work?: Var*&
var
te = Numeric functions: nownow + dt Instructions: var
How does VScript::Value() work?: Var*&
var
z,l,i,j Instructions: var
How does VScript::Value() work?: Var*&
var
s = "|/-\\", si = 1, st=ta Instructions: procproc fak(n) { Flow control: if … thenif n<=1 Flow control: returnreturn 1 Flow control: if … then
Flow control: try … then
else
Flow control: returnreturn fak(n-1)*n Flow control: if … then
Flow control: try … then
then
} i=0 Flow control: do … loopdo Flow control: whilewhile Numeric functions: nownow < te i++ Flow control: if … thenif Numeric functions: nownow>st st+=0.100 Instructions: putput s[1+si++%4],"\b" Flow control: if … then
Flow control: try … then
then
fak(100) l = {0,1,2,3,4,5,6,7,8,9} l ##= l+10 l ##= l+20 l ##= l+40 l ##= l+80 l=l[to 100] Flow control: if … thenif Numeric functions: minmin(l)!=0 Numeric functions: log
Numeric functions: loge
Instructions: log
log
"booboo1",Constants: nlnl Flow control: end
Shell Immediate Commands: exit, quit, end
end
Flow control: if … then
Flow control: try … then
then
Flow control: if … thenif Numeric functions: maxmax(l)!=99 Numeric functions: log
Numeric functions: loge
Instructions: log
log
"booboo2",Constants: nlnl Flow control: end
Shell Immediate Commands: exit, quit, end
end
Flow control: if … then
Flow control: try … then
then
z = l; j=0 Flow control: do … loopdo Flow control: whilewhile ++j<=100 Instructions: swapswap z[1+Numeric functions: randomrandom 100], z[1+Numeric functions: randomrandom 100] Flow control: do … looploop Instructions: sortsort z Flow control: if … thenif z!=l Numeric functions: log
Numeric functions: loge
Instructions: log
log
"booboo3",Constants: nlnl Numeric functions: log
Numeric functions: loge
Instructions: log
log
z,Constants: nlnl Flow control: end
Shell Immediate Commands: exit, quit, end
end
Flow control: if … then
Flow control: try … then
then
z = "" j=0 Flow control: do … loopdo Flow control: whilewhile ++j<=100 z#=l[j] Flow control: do … looploop Flow control: if … thenif z[to 20]!="01234567891011121314" Numeric functions: log
Numeric functions: loge
Instructions: log
log
"booboo4",Constants: nlnl Flow control: end
Shell Immediate Commands: exit, quit, end
end
Flow control: if … then
Flow control: try … then
then
Flow control: do … looploop Instructions: putput " ",Constants: nlnl Instructions: putput "yeah! i made ",i," Flow control: do … looploops in ",dt," seconds!",Constants: nlnl Instructions: putput "that's nearly ",i/dt/710," megaboogies!",Constants: nlnl Instructions: putput "unbelievable...",Constants: nlnl Flow control: returnreturn i/dt/710 # " megaboogies" Flow control: end
Shell Immediate Commands: exit, quit, end
end

VIP Script Test Suite

List functions: thisThis is Flow control: if … then
Flow control: try … then
the
primary test suite used to test Flow control: if … then
Flow control: try … then
the
interpreter. Lots of test are missing. Yes, i know. Send in what ever you like...

Flow control: if … then
Flow control: try … then
The
test suite is part of every distribution Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
and
List functions: thisthis Online Chat: Listings
Search Site: Listing
Print Environment: Listing
Online Z80 Assembler: Listing
Show Beautified Folder Listings: Listing
Sort-of-a Shell: Listing
Factorial "!": Listing
Prime Factor Factorizing: Listing
Speedometer: Listing
VIP Script Test Suite: Listing
listing
may Operators: Bitwise Not "~"
Operators: Boolean Negation "!"
not
be up to date.

Download directory

test_suite/

Listing

#!/usr/local/bin/vipsi

/* ---- vipsi test Example Scripts: CGI Scripts
Example Scripts: Scripts
script
---------------------------- test a lot of vipsi functionality Operators: Add to Variable "+="
Operators: Add "+"
add
more tests as you like ... demonstrates syntax Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
and
capabilities as well kio 2001-08-24 kio 2002-03-09 kio 2002-03-31 kio 2003-08-14 kio 2004-06-21 List functions: split
Instructions: split
split
into Functions with varying return types: include
Instructions: include
include
Text functions: file
Instructions: file
files
*/ Instructions: putput Constants: nlnl,Constants: nlnl,"test Example Scripts: CGI Scripts
Example Scripts: Scripts
script
for vipsi",Constants: nlnl Flow control: if … thenif Numeric functions: countcount List functions: globals
Shell Immediate Commands: globals
globals
Numeric functions: log
Numeric functions: loge
Instructions: log
log
Constants: nlnl, Numeric functions: countcount List functions: globals
Shell Immediate Commands: globals
globals
, " List functions: globals
Shell Immediate Commands: globals
global
Glossary: Variable, var_refvariable", "s"[Numeric functions: countcount List functions: globals
Shell Immediate Commands: globals
globals
>1], " already defined:", Constants: nlnl { Instructions: var
How does VScript::Value() work?: Var*&
var
i=1; Flow control: do … loopdo Flow control: whilewhile i<Numeric functions: countcount List functions: globals
Shell Immediate Commands: globals
globals
// List functions: globals
Shell Immediate Commands: globals
globals
[Numeric functions: countcount List functions: globals
Shell Immediate Commands: globals
globals
] = List functions: localslocal { … } Flow control: if … thenif Vipsi command syntax: Identifiers (names)
Identifiers, names
Operators: Make Identifier "@"
Text functions: name
Glossary: Name, Identifier
name
List functions: globals
Shell Immediate Commands: globals
globals
[i]!="" Numeric functions: log
Numeric functions: loge
Instructions: log
log
Vipsi command syntax: Identifiers (names)
Identifiers, names
Operators: Make Identifier "@"
Text functions: name
Glossary: Name, Identifier
name
List functions: globals
Shell Immediate Commands: globals
globals
[i], " = " Flow control: if … then
Flow control: try … then
else
Numeric functions: log
Numeric functions: loge
Instructions: log
log
"unnamed Glossary: Variable, var_refvariable: " Flow control: if … then
Flow control: try … then
then
Numeric functions: log
Numeric functions: loge
Instructions: log
log
List functions: globals
Shell Immediate Commands: globals
globals
[i], Constants: nlnl i=i+1 Flow control: do … looploop } Flow control: if … then
Flow control: try … then
then
Instructions: deldel * Instructions: var
How does VScript::Value() work?: Var*&
var
a,b,c,d Instructions: var
How does VScript::Value() work?: Var*&
var
err = 0; Instructions: var
How does VScript::Value() work?: Var*&
var
errors = 0 Instructions: var
How does VScript::Value() work?: Var*&
var
e,f,g,h,n err=0 // ---------------------------------------------------------- Instructions: putput Constants: nlnl,"basic test requirements " Instructions: putput ".", 47+2; // just execute it Instructions: putput ".", "123"; Instructions: putput "." n=1 Flow control: if … thenif 0 Numeric functions: log
Numeric functions: loge
Instructions: log
log
"test ",n," failed" Flow control: end
Shell Immediate Commands: exit, quit, end
end
Flow control: if … then
Flow control: try … then
then
Instructions: putput "." n=2 a=4 Flow control: if … thenif a!=4 Numeric functions: log
Numeric functions: loge
Instructions: log
log
"test ",n," failed" Flow control: end
Shell Immediate Commands: exit, quit, end
end
Flow control: if … then
Flow control: try … then
then
Instructions: putput "." n=3 a++ Flow control: if … thenif a!=5 Numeric functions: log
Numeric functions: loge
Instructions: log
log
"test ",n," failed" Flow control: end
Shell Immediate Commands: exit, quit, end
end
Flow control: if … then
Flow control: try … then
then
Instructions: putput "." n=4 a-- Flow control: if … thenif a!=4 Numeric functions: log
Numeric functions: loge
Instructions: log
log
"test ",n," failed" Flow control: end
Shell Immediate Commands: exit, quit, end
end
Flow control: if … then
Flow control: try … then
then
Instructions: putput "." n=5 a=1 b=2 a=b Flow control: if … thenif a!=2||b!=2 Numeric functions: log
Numeric functions: loge
Instructions: log
log
"test ",n," failed" Flow control: end
Shell Immediate Commands: exit, quit, end
end
Flow control: if … then
Flow control: try … then
then
Instructions: putput "." n=6 a=3 Instructions: var
How does VScript::Value() work?: Var*&
var
z=a Flow control: if … thenif a!=3||z!=3 Numeric functions: log
Numeric functions: loge
Instructions: log
log
"test ",n," failed" Flow control: end
Shell Immediate Commands: exit, quit, end
end
Flow control: if … then
Flow control: try … then
then
Instructions: putput "." n=7 Flow control: if … thenif 0 Numeric functions: log
Numeric functions: loge
Instructions: log
log
"test ",n," failed" Flow control: end
Shell Immediate Commands: exit, quit, end
end
Flow control: if … then
Flow control: try … then
else
; Flow control: if … then
Flow control: try … then
then
Instructions: putput "." n=8 Flow control: if … thenif 0 Numeric functions: log
Numeric functions: loge
Instructions: log
log
"test ",n," failed" Flow control: end
Shell Immediate Commands: exit, quit, end
end
Flow control: if … then
Flow control: try … then
then
Instructions: putput "." n=9 Flow control: if … thenif 1 ; Flow control: if … then
Flow control: try … then
else
Numeric functions: log
Numeric functions: loge
Instructions: log
log
"test ",n," failed" Flow control: end
Shell Immediate Commands: exit, quit, end
end
Flow control: if … then
Flow control: try … then
then
Instructions: putput "." n=11 Flow control: if … thenif err!=0 Numeric functions: log
Numeric functions: loge
Instructions: log
log
"test ",n," failed" Flow control: end
Shell Immediate Commands: exit, quit, end
end
Flow control: if … then
Flow control: try … then
then
Instructions: putput "." n=12 err++; Flow control: if … thenif err!=1 Numeric functions: log
Numeric functions: loge
Instructions: log
log
"test ",n," failed" Flow control: end
Shell Immediate Commands: exit, quit, end
end
Flow control: if … then
Flow control: try … then
then
Instructions: putput "." n=13 err--; Flow control: if … thenif err!=0 Numeric functions: log
Numeric functions: loge
Instructions: log
log
"test ",n," failed" Flow control: end
Shell Immediate Commands: exit, quit, end
end
Flow control: if … then
Flow control: try … then
then
Instructions: putput "." n=14 Instructions: procproc trap(f) { Flow control: if … thenif f err++ Flow control: if … then
Flow control: try … then
then
} Instructions: putput "." n=15 trap(0) Flow control: if … thenif err!=0 Numeric functions: log
Numeric functions: loge
Instructions: log
log
"test ",n," failed" Flow control: end
Shell Immediate Commands: exit, quit, end
end
Flow control: if … then
Flow control: try … then
then
Instructions: putput "." n=16 trap(1) Flow control: if … thenif err!=1 Numeric functions: log
Numeric functions: loge
Instructions: log
log
"test ",n," failed" Flow control: end
Shell Immediate Commands: exit, quit, end
end
Flow control: if … then
Flow control: try … then
then
err-- /* trap() */ Instructions: putput "." n=17 Instructions: procproc trap(f) { Instructions: putput "."; Flow control: if … thenif f err++ Numeric functions: log
Numeric functions: loge
Instructions: log
log
"#",n," failed" Flow control: if … then
Flow control: try … then
then
} n=18 trap(0) Flow control: if … thenif err!=0 Flow control: end
Shell Immediate Commands: exit, quit, end
end
Flow control: if … then
Flow control: try … then
then
/* assert() */ Instructions: putput "." n=19 Instructions: procproc assert(f) { Instructions: putput "."; Flow control: if … thenif !f; Numeric functions: log
Numeric functions: loge
Instructions: log
log
"#",n," failed"; err++; Flow control: if … then
Flow control: try … then
then
; } n=20 assert(1) Flow control: if … thenif err Flow control: end
Shell Immediate Commands: exit, quit, end
end
Flow control: if … then
Flow control: try … then
then
/* NaN */ Instructions: putput "." n=21 Instructions: var
How does VScript::Value() work?: Var*&
var
nan = 0/0 n=22 Instructions: procproc IsNan(n){Flow control: returnreturn n!=n} /* inf */ Instructions: putput "." n=24 Instructions: var
How does VScript::Value() work?: Var*&
var
inf = 1e99999 /* > 18 bit exponent */ n=25 Instructions: procproc IsInf(n){Flow control: returnreturn n+1==n-1 } Instructions: putput " passed",Constants: nlnl Instructions: putput Constants: nlnl,"inf, nan, +0, -0 " Flow control: try … thentry n=1 assert(IsNan(nan)) n=2 assert(IsInf(inf)) n=3 assert(inf==inf+1) Flow control: if … thenif err Flow control: end
Shell Immediate Commands: exit, quit, end
end
Flow control: if … then
Flow control: try … then
then
n=4 assert(inf==inf-1) Flow control: if … thenif err Flow control: end
Shell Immediate Commands: exit, quit, end
end
Flow control: if … then
Flow control: try … then
then
n=5 assert(inf*-1==-inf) n=6 assert(IsNan(inf/inf)) n=10 Instructions: putput"." Flow control: try … thentry a=1e777777777 Flow control: if … then
Flow control: try … then
else
Numeric functions: log
Numeric functions: loge
Instructions: log
log
"#10 failed" err++ Flow control: if … then
Flow control: try … then
then
n=11 Instructions: putput"." Flow control: try … thentry a=-1e777777777 Flow control: if … then
Flow control: try … then
else
Numeric functions: log
Numeric functions: loge
Instructions: log
log
"#11 failed" err++ Flow control: if … then
Flow control: try … then
then
n=12 Instructions: putput"." Flow control: try … thentry a=1e-777777777 Flow control: if … then
Flow control: try … then
else
Numeric functions: log
Numeric functions: loge
Instructions: log
log
"#12 failed" err++ Flow control: if … then
Flow control: try … then
then
n=13 Instructions: putput"." Flow control: try … thentry a=-1e-777777777 Flow control: if … then
Flow control: try … then
else
Numeric functions: log
Numeric functions: loge
Instructions: log
log
"#13 failed" err++ Flow control: if … then
Flow control: try … then
then
n=14 assert( 1e-77777777 == -1e-77777777 ) // +0 == -0 Flow control: if … then
Flow control: try … then
else
Numeric functions: log
Numeric functions: loge
Instructions: log
log
"test#",n," bummered: ", error.message err++ Flow control: if … then
Flow control: try … then
then
Flow control: if … thenif !err Instructions: putput " passed" Flow control: if … then
Flow control: try … then
else
errors+=err err=0 Flow control: if … then
Flow control: try … then
then
//Instructions: cd
Shell Immediate Commands: cd
cd
(Text functions: fullpathfullpath(".") # "00_test.vs")[to Numeric functions: rfindrfind(Text functions: fullpathfullpath(".") # "00_test.vs","/")] //Instructions: var
How does VScript::Value() work?: Var*&
var
d = List functions: env
Shell Immediate Commands: env
Shell Immediate Commands: env
env
._ //Instructions: cd
Shell Immediate Commands: cd
cd
d[to Numeric functions: rfindrfind(d,"/")] Instructions: cd
Shell Immediate Commands: cd
cd
job.Example Scripts: CGI Scripts
Example Scripts: Scripts
script
[to Numeric functions: rfindrfind(job.Example Scripts: CGI Scripts
Example Scripts: Scripts
script
,"/")] // own Functions with varying return types: include
Instructions: include
includes
Functions with varying return types: include
Instructions: include
include
"each_and_every.vs" a=0 Functions with varying return types: include
Instructions: include
include
"operators_compare.vs" b=0 Functions with varying return types: include
Instructions: include
include
"operators_numeric.vs" Functions with varying return types: include
Instructions: include
include
"operators_text.vs" Functions with varying return types: include
Instructions: include
include
"operators_pruning.vs" Functions with varying return types: include
Instructions: include
include
"functions_text.vs" Functions with varying return types: include
Instructions: include
include
"functions_numeric.vs" Functions with varying return types: include
Instructions: include
include
"functions_list.vs" Functions with varying return types: include
Instructions: include
include
"Vipsi command syntax: Identifiers (names)
Identifiers, names
Operators: Make Identifier "@"
Text functions: name
Glossary: Name, Identifier
names
.vs" Functions with varying return types: include
Instructions: include
include
"instructions_branching.vs" Functions with varying return types: include
Instructions: include
include
"Vipsi command syntax: Procedures
Data Types: Procedures
Glossary: Procedure
procedures
.vs" Functions with varying return types: include
Instructions: include
include
"variable_protection.vs" Instructions: var
How does VScript::Value() work?: Var*&
var
wdir = Text functions: fullpathfullpath "." Functions with varying return types: include
Instructions: include
include
"include_sys_call.vs" Instructions: cd
Shell Immediate Commands: cd
cd
wdir Functions with varying return types: include
Instructions: include
include
"files_etc.vs" Instructions: cd
Shell Immediate Commands: cd
cd
wdir Flow control: try … thentry Functions with varying return types: include
Instructions: include
include
"old_bugs.vs" Flow control: if … then
Flow control: try … then
else
Numeric functions: log
Numeric functions: loge
Instructions: log
log
Constants: nlnlFunctions with varying return types: include
Instructions: include
include
"old_bugs.vs" bummered: »,error.message err++ Flow control: if … then
Flow control: try … then
then
// ---------------------------------------------------------- Flow control: if … thenif errors Instructions: putput Constants: nlnl," ",Constants: nlnl Numeric functions: log
Numeric functions: loge
Instructions: log
log
"--- ",errors," errors total ---" Instructions: putput Constants: nlnl Flow control: if … then
Flow control: try … then
else
Instructions: putput Constants: nlnl," ",Constants: nlnl,"+++ all tests passed +++",Constants: nlnl,Constants: nlnl Flow control: if … then
Flow control: try … then
then
Flow control: end
Shell Immediate Commands: exit, quit, end
end

Valid HTML   Valid CSS