vipsi - the friendly vip script interpreter

Example Scripts

Libraries

BOOK: Create Online Books

Listing of BOOK.vl

#!/usr/local/bin/vipsi


/*  create online book from easy source
    ***TODO*** Tables

    authoritative Text functions: file
Instructions: file
file
: /pub/Develop/projects/vipsi/libs/BOOK.vl */ Instructions: var
How does VScript::Value() work?: Var*&
var
Startzeit = Numeric functions: nownow Instructions: var
How does VScript::Value() work?: Var*&
var
Statistics = {} Instructions: var
How does VScript::Value() work?: Var*&
var
LibDir = "/usr/local/lib/vipsi/" Instructions: var
How does VScript::Value() work?: Var*&
var
NumFiles = 0 Instructions: var
How does VScript::Value() work?: Var*&
var
Seed = 0 Flow control: if … thenif !Numeric functions: existsexists verbose Instructions: var
How does VScript::Value() work?: Var*&
var
verbose=0 Flow control: if … then
Flow control: try … then
then
/* ---- Defaults ---------------------- */ Instructions: var
How does VScript::Value() work?: Var*&
var
SourceFile = "*.toc" // Data Types: Lists and arrays
Item selector "[]": Lists
Glossary: list, list_val
list
of source Text functions: file
Instructions: file
files
, Operators: Multiply "*"wildcards allowed Instructions: var
How does VScript::Value() work?: Var*&
var
TargetDir = "" Instructions: var
How does VScript::Value() work?: Var*&
var
FilenameIndex = "Numeric functions: indexindex.html" Instructions: var
How does VScript::Value() work?: Var*&
var
FilenameBook = "z%%.htm" // Vipsi command syntax: Identifiers (names)
Identifiers, names
Operators: Make Identifier "@"
Text functions: name
Glossary: Name, Identifier
name
for target Text functions: file
Instructions: file
files
; %% = sequential Glossary: number, num_valnumber Instructions: var
How does VScript::Value() work?: Var*&
var
SplitFileSize = 20000 // limit for splitting chapters into multiple Text functions: file
Instructions: file
files
Instructions: var
How does VScript::Value() work?: Var*&
var
TabWidth = 4 // used to detab <pre> sections Instructions: var
How does VScript::Value() work?: Var*&
var
XrefMaxWords = 4 // Numeric functions: maxmax. significant List functions: words
Shell Immediate Commands: words
words
for automatic cross Text functions: link
Instructions: link
links
generation Instructions: var
How does VScript::Value() work?: Var*&
var
PageTocMinCount = 2 // Numeric functions: minmin. Glossary: number, num_valnumber of Text functions: link
Instructions: link
links
in TOC of single Text functions: file
Instructions: file
file
for TOC present; Flow control: if … then
Flow control: try … then
else
no TOC /* ---- Basic Html Templates ---------------------------- Template.Page für normale Seiten Template.Numeric functions: indexIndex für die Startseite Template.List functions: split
Instructions: split
Split
für die TOC-Seite von Kapiteln, die gesplittet wurden */ Instructions: var
How does VScript::Value() work?: Var*&
var
Template.Page = «<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head> <META http-equiv=Content-Type content="Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
text
/html; charset=UTF-8"> <title>%%TITLE%%</title> <meta Vipsi command syntax: Identifiers (names)
Identifiers, names
Operators: Make Identifier "@"
Text functions: name
Glossary: Name, Identifier
name
="keywords" content="%%KEYWORDS%%"> <style type="Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
text
/css"> .titel { background:white; text-align:center; } .head { background:white; text-align:center; } .toc { background:white; padding:0.25em; margin:1em; } .toc p { text-align:center; font-weight:bold; padding:0em; margin:0em; } .L { background:#ffffdd; } .L span { background:#ffff88; visibility:hidden; position:absolute; z-index:50; padding:0.2em; } </style> <Example Scripts: CGI Scripts
Example Scripts: Scripts
script
type="Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
text
/javascript"> Instructions: var
How does VScript::Value() work?: Var*&
var
o=""; Vipsi command syntax: Functions
Functions
Glossary: Function
function
S(n) { H(); document.getElementById(n).style.visibility='visible'; o=n; } Vipsi command syntax: Functions
Functions
Glossary: Function
function
H() { Flow control: if … thenif(o!="") document.getElementById(o).style.visibility='hidden'; o=""; } </Example Scripts: CGI Scripts
Example Scripts: Scripts
script
> </head><body id="A"> %%HEADLINE0%%%%HEADLINE1%% <p align=center><a href="%%PREV%%">[&lt;prev]</a> &nbsp; &nbsp; <a href="%%Flow control: nextNEXT%%">[Flow control: nextnext&gt;]</a></p> %%HEADLINE2%%%%HEADLINE3%%%%HEADLINE4%%%%HEADLINE5%%%%HEADLINE6%% %%TOC%%%%BODY%% </body></html> » // Headlines as they appear Operators: Make Identifier "@"at top of a page // called for %%HEADLINEx%% Instructions: procproc Style.Headline( i /* Buch[i] */ ) { Instructions: var
How does VScript::Value() work?: Var*&
var
Tag = Vipsi command syntax: Identifiers (names)
Identifiers, names
Operators: Make Identifier "@"
Text functions: name
Glossary: Name, Identifier
name
Buch[i] Instructions: var
How does VScript::Value() work?: Var*&
var
Url = Buch[i].Filename Instructions: var
How does VScript::Value() work?: Var*&
var
Label = Buch[i].Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
Flow control: if … thenif Tag=="h0" Instructions: var
How does VScript::Value() work?: Var*&
var
r = «\n<h1 class="titel"><a href="»#Url# «">» #Label# «</a></h1>» Flow control: try … thentry r #= «\n<h1 class="head"><a href="» #Url# «">» #TocTitle# «</a></h1>» Instructions: deldel TocTitle Flow control: if … then
Flow control: try … then
then
Flow control: returnreturn r Flow control: if … then
Flow control: try … then
else
Flow control: returnreturn «\n<»#Tag#« class="head"><a href="»#Url# «">» #Label# «</a></»#Tag#«>» Flow control: if … then
Flow control: try … then
then
} // Headlines as they appear in a TOC // called in preparation for %%TOC%% Instructions: procproc Style.TocItem ( i /* Buch[i] */ ) { Instructions: var
How does VScript::Value() work?: Var*&
var
Label = Buch[i].Glossary: text_ref, text_varText var Url = "#" # Buch[i].Anker Flow control: try … thentry Url = Buch[i].Filename # Url Flow control: if … then
Flow control: try … then
then
Flow control: returnreturn «<p><a href="» #Url# «">» #Label# «</a></p>» } // Table of contents: // called for %%TOC%% Instructions: procproc Style.Toc ( i /* Buch[i] */, TocListe ) { Flow control: returnreturn exists Buch[i].List functions: split
Instructions: split
Split
|| Numeric functions: countcount TocListe >= PageTocMinCount ? «\n<div class="toc">»#TEXT.JoinText(TocListe,Constants: nlnl)#«</div>» : "" } // Querverweis-Linklist-Popup: // for Xref Instructions: procproc Style.Linklist ( Label, Linklist ) // Linklist = { {Url="",Label=""}, ... } { Instructions: var
How does VScript::Value() work?: Var*&
var
i=0, Text functions: link
Instructions: link
Links
="", id = ++Seed Instructions: var
How does VScript::Value() work?: Var*&
var
ID="" Flow control: do … loopdo ID #= Text functions: charstrcharstr('A'+id%26) id/=26 Flow control: whilewhile id>=1 Flow control: do … looploop Flow control: do … loopdo Flow control: whilewhile ++i <= Numeric functions: countcount Linklist Text functions: link
Instructions: link
Links
#= «<br><a href="» #Linklist[i].Url# «">» #Linklist[i].Label# «</a>» Flow control: do … looploop Flow control: returnreturn «<span class=L onMouseOver="S('»#ID#«')">\ <span id=»#ID#« onMouseOut="H()">»#Links[5 to]#«</span>»#Label#«</span>» } /* ********************************************************************* TAG DEFINITIONS ********************************************************************* */ Instructions: procproc SkipBlock(i) // --> Flow control: nextnext block { Instructions: var
How does VScript::Value() work?: Var*&
var
Tag = Vipsi command syntax: Identifiers (names)
Identifiers, names
Operators: Make Identifier "@"
Text functions: name
Glossary: Name, Identifier
name
Buch[i++] Flow control: do … loopdo Flow control: whilewhile i <= Numeric functions: countcount Buch && contains_tag(Tag,Vipsi command syntax: Identifiers (names)
Identifiers, names
Operators: Make Identifier "@"
Text functions: name
Glossary: Name, Identifier
name
Buch[i]) // rekursion notwendig, weil manche tags nur indirekt enthalten sein können, z.b. h4>ol>li i = SkipBlock(i) Flow control: do … looploop Flow control: returnreturn i } Instructions: procproc SizeofBlock(i) { Instructions: var
How does VScript::Value() work?: Var*&
var
j = SkipBlock(i) Instructions: var
How does VScript::Value() work?: Var*&
var
n = 0 Flow control: do … loopdo n += Numeric functions: countcount Data Types: Text
Text functions: string
string
(Buch[i]) Flow control: whilewhile ++i < j Flow control: do … looploop Flow control: returnreturn n } Instructions: procproc ReadContainedTags(i) { Instructions: var
How does VScript::Value() work?: Var*&
var
Tag = Vipsi command syntax: Identifiers (names)
Identifiers, names
Operators: Make Identifier "@"
Text functions: name
Glossary: Name, Identifier
name
Buch[i++] Flow control: do … loopdo Flow control: whilewhile i <= Numeric functions: countcount Buch Instructions: var
How does VScript::Value() work?: Var*&
var
Subtag = Vipsi command syntax: Identifiers (names)
Identifiers, names
Operators: Make Identifier "@"
Text functions: name
Glossary: Name, Identifier
name
Buch[i] Flow control: whilewhile contains_tag(Tag,Subtag) i = Tags.@Subtag.Instructions: readRead(i) Flow control: do … looploop Flow control: returnreturn i } Instructions: procproc WriteContainedTags(F,i) { Instructions: var
How does VScript::Value() work?: Var*&
var
Tag = Vipsi command syntax: Identifiers (names)
Identifiers, names
Operators: Make Identifier "@"
Text functions: name
Glossary: Name, Identifier
name
Buch[i++] Flow control: do … loopdo Flow control: whilewhile i <= Numeric functions: countcount Buch Instructions: var
How does VScript::Value() work?: Var*&
var
Subtag = Vipsi command syntax: Identifiers (names)
Identifiers, names
Operators: Make Identifier "@"
Text functions: name
Glossary: Name, Identifier
name
Buch[i] Flow control: whilewhile contains_tag(Tag,Subtag) i = Tags.@Subtag.Instructions: writeWrite(F,i) Flow control: do … looploop Flow control: returnreturn i } Instructions: procproc WriteStartTag(F,i) { Instructions: var
How does VScript::Value() work?: Var*&
var
id = Vipsi command syntax: Identifiers (names)
Identifiers, names
Operators: Make Identifier "@"
Text functions: name
Glossary: Name, Identifier
name
Buch[i] Flow control: try … thentry id #= « class=» # Buch[i].Class Flow control: if … then
Flow control: try … then
then
// Flow control: if … thenif Numeric functions: existsexists Flow control: try … thentry id #= « style="» # Buch[i].Style # «"» Flow control: if … then
Flow control: try … then
then
// Flow control: if … thenif Numeric functions: existsexists Flow control: try … thentry id #= « id=» # Buch[i].Anker Flow control: if … then
Flow control: try … then
then
// Flow control: if … thenif Numeric functions: existsexists Instructions: putput #F, Constants: nlnl, "<" # id # ">" } Instructions: procproc WriteText(F,i) { Instructions: putput #F, Buch[i].Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
} Instructions: procproc WriteEndTag(F,i) { Instructions: putput #F, "</", Vipsi command syntax: Identifiers (names)
Identifiers, names
Operators: Make Identifier "@"
Text functions: name
Glossary: Name, Identifier
name
Buch[i], ">" } // default Instructions: readread/Instructions: writewrite handler Instructions: procproc r0(i) { Flow control: if … thenif verbose Instructions: putput "["#name Buch[i]#"]" Flow control: if … then
Flow control: try … then
then
Flow control: returnreturn ReadContainedTags(i) } Instructions: procproc w0(F,i) { WriteStartTag(F,i); WriteText(F,i); WriteEndTag(F,i); Flow control: returnreturn i+1 } /* ---- Tag Handler ------------------------------------------------------------------------- Class = PARA paragraphs: enthalten keine anderen Tags: z.B. <p> BLOCK Block-Tags: enthalten andere Tags: alle Headlines und z.B. <ul> PRE Vorformatierter Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
. Sonderform des PARA-Tags: White spaces usw. werden erhalten DEF spezielle Tags: z.B.: toc und # Instructions: readRead = Lesefunktion: Liest via Numeric functions: indexIndex i aus Buch[] und gibt den weitergestellten Numeric functions: indexIndex zurück. Die Default-Lesefunktion r0() für viele Tags inkrementiert nur den Numeric functions: indexIndex und tut sonst nichts. Instructions: writeWrite = Schreibfunktion: Schreibt in Stream F via Numeric functions: indexIndex i aus Buch[] und gibt weitergestellten Numeric functions: indexIndex zurück. Die Default-Schreibfunktion w0() schreibt Start-Tag, Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
und End-Tag. Tag-Name ist der Vipsi command syntax: Identifiers (names)
Identifiers, names
Operators: Make Identifier "@"
Text functions: name
Glossary: Name, Identifier
Name
des Buch-Eintrags Buch[i] Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
ist Buch[i].Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
Buch[i] kann noch Buch[i].Class, Buch[i].Style und Buch[i].Anker enthalten. Where = Data Types: Lists and arrays
Item selector "[]": Lists
Glossary: list, list_val
Liste
der Tags, in denen dieses Tag vorkommen kann. */ // p: plain paragraph, subsequent untagged lines are appended with <br> Instructions: var
How does VScript::Value() work?: Var*&
var
Tags.p = { Class='PARA', Instructions: readRead=r0, Instructions: writeWrite=w0, Where=" h0 h1 h2 h3 h4 h5 h6 " } // pre: preformatted paragraph, monospaced, subsequent untagged lines are appended with \n Instructions: var
How does VScript::Value() work?: Var*&
var
Tags.pre = { Class='PRE', Instructions: readRead=r0, Instructions: writeWrite=w0, Where=" h0 h1 h2 h3 h4 h5 h6 " } // li: Data Types: Lists and arrays
Item selector "[]": Lists
Glossary: list, list_val
list
item; subsequent untagged lines are appended with <br> Instructions: var
How does VScript::Value() work?: Var*&
var
Tags.li = { Class='PARA', Instructions: readRead=r0, Instructions: writeWrite=w0, Where=" ol ul " } // hr: horizontal Operators: Divide with Variable "/="
Operators: Divide "/"
divider
line Instructions: procproc w(F,i) { WriteStartTag(F,i); Flow control: returnreturn i+1 } Instructions: var
How does VScript::Value() work?: Var*&
var
Tags.hr = { Class='DEF', Instructions: readRead=r0, Instructions: writeWrite=w, Where=" h0 h1 h2 h3 h4 " } // TODO: why Operators: Bitwise Not "~"
Operators: Boolean Negation "!"
not
PARA ?!? // #: provide customized Vipsi command syntax: Identifiers (names)
Identifiers, names
Operators: Make Identifier "@"
Text functions: name
Glossary: Name, Identifier
name
for anchor Instructions: procproc r(i) { Flow control: if … thenif verbose Instructions: putput "["#name Buch[i]#"]" Flow control: if … then
Flow control: try … then
then
Flow control: if … thenif Numeric functions: existsexists Buch[i-1].Keywords Buch[i-1] ##= { Anker = Buch[i].Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
} Flow control: if … then
Flow control: try … then
else
Numeric functions: log
Numeric functions: loge
Instructions: log
log
Constants: nlnl, « Tag "#" (custom anchor Vipsi command syntax: Identifiers (names)
Identifiers, names
Operators: Make Identifier "@"
Text functions: name
Glossary: Name, Identifier
name
) darf nur nach Überschriften stehen: ignoriert» Flow control: if … then
Flow control: try … then
then
Instructions: deldel Buch[i]; Flow control: returnreturn i } Instructions: var
How does VScript::Value() work?: Var*&
var
Tags.@"#" = { Class='DEF', Instructions: readRead=r, Instructions: writeWrite=w0, Where=" h0 h1 h2 h3 h4 h5 h6 " } // toc: define title for TOC on Numeric functions: indexindex page Instructions: procproc r(i) { Flow control: if … thenif verbose Instructions: putput "["#name Buch[i]#"]" Flow control: if … then
Flow control: try … then
then
Flow control: if … thenif Numeric functions: existsexists Style.TocTitle Numeric functions: log
Numeric functions: loge
Instructions: log
log
" toc doppelt! " Flow control: if … then
Flow control: try … then
then
Text functions: convert
Instructions: convert
convert
Buch[i].Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
to html Style ##= { TocTitle = Buch[i].Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
}; Instructions: deldel Buch[i]; Flow control: returnreturn i } Instructions: var
How does VScript::Value() work?: Var*&
var
Tags.toc = { Class='DEF', Instructions: readRead=r, Instructions: writeWrite=w0, Where=" h0 " } // ol, ul: (un)ordered Data Types: Lists and arrays
Item selector "[]": Lists
Glossary: list, list_val
list
; contains only li Instructions: procproc w(F,i) { WriteStartTag(F,i); Instructions: var
How does VScript::Value() work?: Var*&
var
j=WriteContainedTags(F,i); WriteEndTag(F,i); Flow control: returnreturn j } Instructions: var
How does VScript::Value() work?: Var*&
var
Tags.ol = { Class='BLOCK', Instructions: readRead=r0, Instructions: writeWrite=w, Where=" h0 h1 h2 h3 h4 h5 h6 " } Instructions: var
How does VScript::Value() work?: Var*&
var
Tags.ul = { Class='BLOCK', Instructions: readRead=r0, Instructions: writeWrite=w, Where=" h0 h1 h2 h3 h4 h5 h6 " } // h0 .. h6: Buchtitel, Headlines Instructions: procproc r(i) { Instructions: var
How does VScript::Value() work?: Var*&
var
j=Numeric functions: findfind("h0h1h2h3h4h5h6",Vipsi command syntax: Identifiers (names)
Identifiers, names
Operators: Make Identifier "@"
Text functions: name
Glossary: Name, Identifier
name
Buch[i]) Flow control: if … thenif verbose Instructions: putput Constants: nlnl, "["#name Buch[i]#"]", " "[to j], Buch[i].Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
Flow control: if … then
Flow control: try … then
else
Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
TEXT
.SpinWheel() Flow control: if … then
Flow control: try … then
then
Flow control: if … thenif Buch[i].Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
== "" Numeric functions: log
Numeric functions: loge
Instructions: log
log
Constants: nlnl, « Kapitel ohne Titel: "», Vipsi command syntax: Identifiers (names)
Identifiers, names
Operators: Make Identifier "@"
Text functions: name
Glossary: Name, Identifier
name
Buch[i], «"», Constants: nlnl, « aborted.» Flow control: end
Shell Immediate Commands: exit, quit, end
end
1 Flow control: if … then
Flow control: try … then
then
Flow control: if … thenif Numeric functions: countcount Buch[i].Keywords==0 Numeric functions: log
Numeric functions: loge
Instructions: log
log
« Keine Schlüsselwörter! » Flow control: if … then
Flow control: try … then
then
Flow control: returnreturn i+1 } Instructions: procproc w(F,i) { // Operators: Bitwise Not "~"
Operators: Boolean Negation "!"
note
: only headlines in %%Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
TEXT
%% are written using List functions: thisthis Instructions: procproc // headlines in page header Operators: Boolean Or with Variable "||="
Operators: Bitwise Or with Variable "|="
Operators: Bitwise Or "|"
Operators: Boolean Or "||"
or
toc are written using Style.xx() Instructions: var
How does VScript::Value() work?: Var*&
var
Anker = Buch[i].Anker Instructions: var
How does VScript::Value() work?: Var*&
var
Titel = Buch[i].Glossary: text_ref, text_varText var Tag = Vipsi command syntax: Identifiers (names)
Identifiers, names
Operators: Make Identifier "@"
Text functions: name
Glossary: Name, Identifier
name
Buch[i] WriteStartTag(F,i) Instructions: putput#F, «<a href="#», Anker, «">», Titel, «</a>» WriteEndTag(F,i) Flow control: returnreturn i+1 } Instructions: var
How does VScript::Value() work?: Var*&
var
Tags.h0 = { Class='BLOCK', Instructions: readRead=r, Instructions: writeWrite=w, Where=" " } Instructions: var
How does VScript::Value() work?: Var*&
var
Tags.h1 = { Class='BLOCK', Instructions: readRead=r, Instructions: writeWrite=w, Where=" h0 " } Instructions: var
How does VScript::Value() work?: Var*&
var
Tags.h2 = { Class='BLOCK', Instructions: readRead=r, Instructions: writeWrite=w, Where=" h1 " } Instructions: var
How does VScript::Value() work?: Var*&
var
Tags.h3 = { Class='BLOCK', Instructions: readRead=r, Instructions: writeWrite=w, Where=" h1 h2 " } Instructions: var
How does VScript::Value() work?: Var*&
var
Tags.h4 = { Class='BLOCK', Instructions: readRead=r, Instructions: writeWrite=w, Where=" h1 h2 h3 " } Instructions: var
How does VScript::Value() work?: Var*&
var
Tags.h5 = { Class='BLOCK', Instructions: readRead=r, Instructions: writeWrite=w, Where=" h1 h2 h3 h4 " } Instructions: var
How does VScript::Value() work?: Var*&
var
Tags.h6 = { Class='BLOCK', Instructions: readRead=r, Instructions: writeWrite=w, Where=" h1 h2 h3 h4 h5 " } Instructions: procproc is_valid_tag ( Tag ) { Flow control: returnreturn Numeric functions: existsexists Tags.@Tag } Instructions: procproc is_para_tag ( Tag ) { Flow control: returnreturn Tags.@Tag.Class=='PARA' } Instructions: procproc is_pre_tag ( Tag ) { Flow control: returnreturn Tags.@Tag.Class=='PRE' } Instructions: procproc is_block_tag ( Tag ) { Flow control: returnreturn Tags.@Tag.Class=='BLOCK' } Instructions: procproc is_def_tag ( Tag ) { Flow control: returnreturn Tags.@Tag.Class=='DEF' } Instructions: procproc contains_tag ( Tag, Subtag ) { Flow control: returnreturn Numeric functions: findfind( Tags.@Subtag.Where, " "#Tag#" " ) != 0 } /* ---- Generated filenames ---------------------------------------------- first filename is 'Buch.dir: fnamefname' = 'FilenameIndex' = "Numeric functions: indexindex.html" subsequent filenames are named according to 'FilenameBook' = "%%.html" */ Instructions: procproc FilenameFromIndex(idx) { Flow control: returnreturn idx==1 ? FilenameIndex : Text functions: replace
Instructions: replace
replace
( FilenameBook, "%%", Data Types: Text
Text functions: string
string
(idx) ); } Instructions: procproc NewFilename() { Flow control: returnreturn FilenameFromIndex( ++NumFiles ) } Instructions: procproc IndexFromFilename(dir: fnamefname) { Flow control: if … thenif dir: fnamefname==FilenameIndex Flow control: returnreturn 1 Flow control: if … then
Flow control: try … then
then
Instructions: var
How does VScript::Value() work?: Var*&
var
i = Numeric functions: findfind(FilenameBook,"%%") Instructions: var
How does VScript::Value() work?: Var*&
var
n = 2 +Numeric functions: countcount dir: fnamefname -Numeric functions: countcount FilenameBook Flow control: returnreturn Functions with varying return types: eval
Instructions: eval
eval
( Text functions: midstrmidstr(dir: fnamefname,i,n ) ) } Instructions: procproc NextFilename(dir: fnamefname) { Instructions: var
How does VScript::Value() work?: Var*&
var
i = IndexFromFilename(dir: fnamefname) Flow control: returnreturn FilenameFromIndex( i%NumFiles +1 ) } Instructions: procproc PrevFilename(dir: fnamefname) { Instructions: var
How does VScript::Value() work?: Var*&
var
i = IndexFromFilename(dir: fnamefname) Flow control: returnreturn FilenameFromIndex( i==1 ? NumFiles : (i-1)%NumFiles ) } /* ---- Die Querverweis-Datei ----------------------------------------------- Zu jedem Schlüsselwort enthält sie die passenden Text functions: link
Instructions: link
Links
, bestehend aus Beschriftung (Label) und Url, die wiederum aus Dateiname und idR. Anker besteht. Das Label setzt sich aus den hierarchischen Kapitelüberschriften zusammen der besseren Lesbarkeit wegen nur eigene HL + übergeordnetes Kapitel */ Instructions: var
How does VScript::Value() work?: Var*&
var
Xref = {} Instructions: procproc AddXref ( Keyword, Label, Text functions: file
Instructions: file
File
, Anker ) { Instructions: var
How does VScript::Value() work?: Var*&
var
Url = Text functions: file
Instructions: file
File
# "#" # Anker Instructions: var
How does VScript::Value() work?: Var*&
var
Text functions: link
Instructions: link
Link
= { Label=Label, Text functions: file
Instructions: file
File
=Text functions: file
Instructions: file
File
, Anker=Anker } Flow control: if … thenif Numeric functions: existsexists Xref.@Keyword // Text functions: link
Instructions: link
Link
mit bereits existierendem Schlüsselwort Flow control: if … thenif !Numeric functions: existsexists Xref.@Keyword.@Url // vermeide Dubletten Xref.@Keyword ##= { @Url = Text functions: link
Instructions: link
Link
} Flow control: if … then
Flow control: try … then
else
Numeric functions: log
Numeric functions: loge
Instructions: log
log
Constants: nlnl, " Verweisziel-Dublette: ",Label," " Flow control: if … then
Flow control: try … then
then
Flow control: if … then
Flow control: try … then
else
// Text functions: link
Instructions: link
Link
mit neuem Schlüsselwort Xref ##= { @Keyword = { @Url = Text functions: link
Instructions: link
Link
} } Flow control: if … then
Flow control: try … then
then
} Instructions: procproc FindXref ( Keyword ) { Flow control: try … thentry Flow control: returnreturn Xref.@Keyword Flow control: if … then
Flow control: try … then
else
Flow control: returnreturn {} Flow control: if … then
Flow control: try … then
then
} /* ********************************************************************* INITIALIZE & TEST for QUICK Flow control: exit
Shell Immediate Commands: exit, quit, end
EXIT
********************************************************************* */ /* ---- flatten Instructions: var
How does VScript::Value() work?: Var*&
var
SourceFiles ------------------------------------- Instructions: readread all directory informations of source Text functions: file
Instructions: file
files
into Instructions: var
How does VScript::Value() work?: Var*&
var
sourcefile Instructions: var
How does VScript::Value() work?: Var*&
var
SourceFiles becomes a directory 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
, except that dir: fnamefnames are extended to full partial path. ((that is: including subdirectory paths)) Text functions: file
Instructions: file
files
are kept in order of appearance in SourceFiles[] Data Types: Lists and arrays
Item selector "[]": Lists
Glossary: list, list_val
list
multiple Text functions: file
Instructions: file
files
matching a Operators: Multiply "*"wildcard pattern are sorted alphabetically duplicate Text functions: file
Instructions: file
files
are removed ((first occurance is kept)) */ Instructions: var
How does VScript::Value() work?: Var*&
var
SourceText = "" Instructions: var
How does VScript::Value() work?: Var*&
var
SourceMdate = 0 Instructions: var
How does VScript::Value() work?: Var*&
var
SourceFiles = 0 Instructions: procproc QuelltextEinlesen() { /* Instructions: readread source Text functions: file
Instructions: file
file
including all included Text functions: file
Instructions: file
files
Flow control: returnreturn Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
text
from Text functions: file
Instructions: file
files
sfile can be: - path/filename - path/ - path/pattern Flow control: if … thenif directory contains one *.toc Text functions: file
Instructions: file
file
Flow control: if … then
Flow control: try … then
then
only List functions: thisthis is included assuming that it will Functions with varying return types: include
Instructions: include
include
Flow control: if … then
Flow control: try … then
the
rest. */ Instructions: procproc read_source(indent, sfile) { indent += 2 Flow control: if … thenif verbose Instructions: putput Constants: nlnl, " "[to indent], sfile, " " Flow control: if … then
Flow control: try … then
else
Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
TEXT
.SpinWheel() Flow control: if … then
Flow control: try … then
then
Flow control: if … thenif Numeric functions: isfileisfile sfile // Text functions: file
Instructions: file
file
SourceMdate = Numeric functions: maxmax(SourceMdate,Numeric functions: mdatemdate sfile) SourceFiles ++ Instructions: var
How does VScript::Value() work?: Var*&
var
sdir = sfile[to Numeric functions: rfindrfind(sfile,"/")] Instructions: var
How does VScript::Value() work?: Var*&
var
result = "" Instructions: var
How does VScript::Value() work?: Var*&
var
Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
text
= Text functions: file
Instructions: file
file
sfile Text functions: convert
Instructions: convert
convert
Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
text
from utf8 Text functions: replace
Instructions: replace
replace
Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
text
, "%%DATE%%", Text functions: datestrdatestr(Numeric functions: nownow) Text functions: replace
Instructions: replace
replace
Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
text
, "%%Text functions: file
Instructions: file
FILE
%%", sfile Flow control: do … loopdo Instructions: var
How does VScript::Value() work?: Var*&
var
j = Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
text
[1]=="+" ? 0 : Numeric functions: findfind(Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
text
,"\n+") Flow control: whilewhile Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
text
[j+1]=="+" Flow control: if … thenif Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
text
[j+2]>" " result #= Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
text
[to j+1] Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
text
=Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
text
[j+2 to] Flow control: nextnext Flow control: if … then
Flow control: try … then
then
result #= Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
text
[to j] sfile = Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
text
[j+2 to Numeric functions: findfind(Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
text
,Constants: nlnl,j+2)-1] Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
text
= Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
text
[Numeric functions: findfind(Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
text
,Constants: nlnl,j+2)+1 to] sfile = Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
TEXT
.CropSpaces(sfile) result #= read_source(indent,sdir#sfile) Flow control: do … looploop Flow control: returnreturn result # Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
text
Flow control: if … then
Flow control: try … then
then
Flow control: if … thenif Numeric functions: isdirisdir sfile // List functions: dir
Instructions: dir
Shell Immediate Commands: dir
dir
Instructions: var
How does VScript::Value() work?: Var*&
var
sdir = sfile Flow control: if … thenif Text functions: rightstrrightstr(sdir,1)!="/" sdir#="/" Flow control: if … then
Flow control: try … then
then
Instructions: var
How does VScript::Value() work?: Var*&
var
d = List functions: dir
Instructions: dir
Shell Immediate Commands: dir
dir
(sdir#"*.toc") Flow control: if … thenif Numeric functions: countcount d == 1 Flow control: returnreturn read_source(indent-2,sdir#d[1].dir: fnamefname) Flow control: if … then
Flow control: try … then
then
Instructions: var
How does VScript::Value() work?: Var*&
var
d = List functions: dir
Instructions: dir
Shell Immediate Commands: dir
dir
sdir Flow control: if … thenif Numeric functions: countcount d == 0 Numeric functions: log
Numeric functions: loge
Instructions: log
log
"empty!" Flow control: returnreturn "" Flow control: if … then
Flow control: try … then
then
Flow control: if … then
Flow control: try … then
else
// List functions: dir
Instructions: dir
Shell Immediate Commands: dir
dir
/pattern Instructions: var
How does VScript::Value() work?: Var*&
var
sdir = sfile[to Numeric functions: rfindrfind(sfile,"/")] Instructions: var
How does VScript::Value() work?: Var*&
var
d = List functions: dir
Instructions: dir
Shell Immediate Commands: dir
dir
(sfile) Flow control: if … then
Flow control: try … then
then
Instructions: sortsort d Instructions: var
How does VScript::Value() work?: Var*&
var
n=0, result = "" Instructions: var
How does VScript::Value() work?: Var*&
var
i=0, Operators: Named Item Selector "."dot = sfile[Numeric functions: countcount(sdir)+1]=="." ? "" : "." Flow control: do … loopdo Flow control: whilewhile ++i <= Numeric functions: countcount d sfile = d[i].dir: fnamefname Flow control: if … thenif Numeric functions: findfind(" alt old backup back-up ",sfile) Flow control: nextnext Flow control: if … then
Flow control: try … then
then
Flow control: if … thenif Text functions: leftstrleftstr (sfile,1)==Operators: Named Item Selector "."dot Flow control: nextnext Flow control: if … then
Flow control: try … then
then
Flow control: if … thenif Text functions: rightstrrightstr(sfile,1)=="~" Flow control: nextnext Flow control: if … then
Flow control: try … then
then
Flow control: if … thenif Text functions: rightstrrightstr(sfile,4)==".bak" Flow control: nextnext Flow control: if … then
Flow control: try … then
then
Flow control: if … thenif Text functions: rightstrrightstr(sfile,4)==".alt" Flow control: nextnext Flow control: if … then
Flow control: try … then
then
Flow control: if … thenif Text functions: rightstrrightstr(sfile,4)==".xxx" Flow control: nextnext Flow control: if … then
Flow control: try … then
then
n++ result #= read_source(indent,sdir#sfile) Flow control: do … looploop Flow control: if … thenif n==0 Numeric functions: log
Numeric functions: loge
Instructions: log
log
"no Numeric functions: matchmatch!" Flow control: if … then
Flow control: try … then
then
Flow control: returnreturn result } Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
TEXT
.SpinCount=0 Instructions: putput Constants: nlnl, "Quelltext einlesen " SourceText = read_source(0,SourceFile) Flow control: if … thenif !verbose Instructions: putput "--> ", Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
TEXT
.SpinCount, " Dateien & Ordner" Flow control: if … then
Flow control: try … then
then
} /* ---- ist Numeric functions: indexindex.html up-to-date? ------------------------------ --> nothing to Flow control: do … loopdo --> QUICK Flow control: exit
Shell Immediate Commands: exit, quit, end
EXIT
*/ Instructions: procproc ÄnderungsdatumPrüfen() { Instructions: putput Constants: nlnl, "Änderungsdatum prüfen " Flow control: try … thentry Flow control: if … thenif force==1 Flow control: returnreturn Flow control: if … then
Flow control: try … then
then
Flow control: if … then
Flow control: try … then
then
// assumption: command line Vipsi command syntax: Arguments
Glossary: Arguments
argument
"-f" --> Instructions: var
How does VScript::Value() work?: Var*&
var
force=1 Flow control: if … thenif Numeric functions: existsexists Text functions: file
Instructions: file
file
(TargetDir#FilenameIndex) { Flow control: if … thenif Numeric functions: maxmax(Numeric functions: mdatemdate(LibDir#"BOOK.vl"),Numeric functions: mdatemdate"automate.vs",SourceMdate) <= Numeric functions: mdatemdate(TargetDir#FilenameIndex) Instructions: putput "... up to date.", Constants: nlnl, Constants: nlnl Flow control: end
Shell Immediate Commands: exit, quit, end
end
0 Flow control: if … then
Flow control: try … then
then
} Flow control: if … then
Flow control: try … then
then
} Instructions: procproc StatisticsAnzeigen() { Instructions: var
How does VScript::Value() work?: Var*&
var
Laufzeit = Data Types: Text
Text functions: string
string
(Numeric functions: intint((now-Startzeit)*1000)) Laufzeit = Laufzeit[to Numeric functions: countcount Laufzeit-3] # "." # Text functions: rightstrrightstr(Laufzeit,3) # " sek." Statistics ##= { Laufzeit = Laufzeit } Instructions: putput Constants: nlnl,Constants: nlnl, "Statistics: " Instructions: var
How does VScript::Value() work?: Var*&
var
i=0 Flow control: do … loopdo Flow control: whilewhile ++i <= Numeric functions: countcount Statistics Instructions: putput Constants: nlnl, " ", Vipsi command syntax: Identifiers (names)
Identifiers, names
Operators: Make Identifier "@"
Text functions: name
Glossary: Name, Identifier
name
Statistics[i], " = ", Statistics[i] Flow control: do … looploop } /* ****************************************************************************** MAIN Vipsi command syntax: Procedures
Data Types: Procedures
Glossary: Procedure
PROCEDURES
****************************************************************************** */ /* ---- Lese Buchquellen ein -------------------------------- Lese SourceFiles und verschmelze alle Dateien zur Data Types: Lists and arrays
Item selector "[]": Lists
Glossary: list, list_val
Liste
"Buch" Items sind Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
text
und mit ihrem Tag benamt Leerzeilen und Kommentare sind entfernt 'pre'-Tags sind ausgetabt p_tags sind verschmolzen; z.B. pre=" a = anton\n b = berta" list_tags mit folgenden untagged Zeilen sind kombiniert; z.B. ort="Land, Wasser, Wald" Blöcke sind rekursiv in Data Types: Lists and arrays
Item selector "[]": Lists
Glossary: list, list_val
Listen
gewandelt Die Data Types: Lists and arrays
Item selector "[]": Lists
Glossary: list, list_val
Listen
werden letztendlich an die Data Types: Lists and arrays
Item selector "[]": Lists
Glossary: list, list_val
Liste
"Buch" angehängt */ Instructions: procproc TagsAbtrennen() { Instructions: putput Constants: nlnl, "Zeilen trennen " Buch = List functions: split
Instructions: split
split
(SourceText) // List functions: split
Instructions: split
split
into lines Statistics ##= { AnzahlQuelldateien = SourceFiles } Statistics ##= { LetzteÄnderung = Text functions: datestrdatestr(SourceMdate) } Statistics ##= { ZeichenGesamt = Numeric functions: countcount SourceText } Statistics ##= { ZeilenGesamt = Numeric functions: countcount Buch } Flow control: if … thenif verbose Instructions: putput Constants: nlnl, " ", Numeric functions: countcount SourceText, " Zeichen " Instructions: putput Constants: nlnl, " ", Numeric functions: countcount Buch, " Zeilen " Flow control: if … then
Flow control: try … then
then
Instructions: putput Constants: nlnl, "Tags abtrennen " // "<tag> <Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
text
>" --> <tag> = { Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
="<Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
text
>" } // "<tag.class> <Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
text
>" --> <tag> = { Class="<class>", Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
="<Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
text
>" } // Crop spaces left Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
and
right // Kommentare entfernen // unbekannte Tags löschen Instructions: var
How does VScript::Value() work?: Var*&
var
keyword Instructions: var
How does VScript::Value() work?: Var*&
var
Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
, Tag, PreTag Instructions: var
How does VScript::Value() work?: Var*&
var
i=0, j, k Flow control: do … loopdo Flow control: whilewhile ++i <= Numeric functions: countcount Buch Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
= Buch[i] Flow control: if … thenif Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
[to 2]=="//" Instructions: deldel Buch[i--] Flow control: nextnext Flow control: if … then
Flow control: try … then
then
// Kommentar Buch[i] = {} // List functions: split
Instructions: split
split
tag j=0 Flow control: do … loopdo Flow control: whilewhile ++j<=Numeric functions: countcount Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
&& Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
[j]>" " Flow control: do … looploop Tag = Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
[to j-1] Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
= Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
[j to] // preserve Separatorsseparator & remember j for <pre> tag // Zeilen mit Tag Flow control: if … thenif Tag!="" Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
TEXT
.SpinWheel(); // List functions: split
Instructions: split
split
css class k = Numeric functions: findfind(Tag,".") Flow control: if … thenif k Buch[i] ##= { Class = Tag[k+1 to] } // store Class Tag = Tag[to k-1] Flow control: if … then
Flow control: try … then
then
// Store Tag Tag = Text functions: lowerstrlowerstr(Tag) Instructions: renamerename Buch[i] = Tag // ungültige Tags löschen Flow control: if … thenif !is_valid_tag(Tag) Numeric functions: log
Numeric functions: loge
Instructions: log
log
Constants: nlnl, « Unbekanntes Tag "», Tag, «": übersprungen» Instructions: deldel Buch[i--]; Flow control: nextnext Flow control: if … then
Flow control: try … then
then
// crop spaces // bei leerem Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
die Folgezeile nachziehen Flow control: do … loopdo // crop spaces Flow control: if … thenif is_pre_tag(Tag) Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
= Text functions: spacestrspacestr(j-1) # Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
// overwrite Tag with spaces Text functions: convert
Instructions: convert
convert
Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
from @("Constants: tabtab"#TabWidth); // Constants: tabtabs durch spaces ersetzen Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
= Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
[TabWidth+1 Text functions: stringto] Text = Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
TEXT
.CropSpaces_R(Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
) Flow control: if … then
Flow control: try … then
else
Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
= Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
TEXT
.CropSpaces(Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
) Flow control: if … then
Flow control: try … then
then
// bei leerem Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
nächste Zeile nachziehen Flow control: whilewhile Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
== "" // solange Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
leer Flow control: whilewhile i<Numeric functions: countcount Buch // und nicht Buch-Ende Flow control: whilewhile Buch[i+1][1] <= " " // und nächste Zeile ohne Tag Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
= Buch[i+1] Instructions: deldel Buch[i+1] j=0 Flow control: do … looploop // Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
speichern Buch[i] ##= { Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
= Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
} // Keyword für Block-Tag speichern Flow control: if … thenif is_block_tag(Tag) Buch[i] ##= { Keywords = {} } keyword = Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
TEXT
.SplitIntoWords(Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
) // List functions: split
Instructions: split
split
into List functions: words
Shell Immediate Commands: words
words
& Separatorsseparators keyword = Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
TEXT
.RemoveOddItems(keyword) // keep List functions: words
Shell Immediate Commands: words
words
keyword = Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
TEXT
.NormalizeName(keyword[to XrefMaxWords]) // normalized joined_words Flow control: if … thenif keyword!="" Buch[i].Keywords ##= keyword Flow control: if … then
Flow control: try … then
then
// store keyword Flow control: if … then
Flow control: try … then
then
// Zeilen ohne Tag // Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
an vorherige Zeile anhängen Flow control: if … then
Flow control: try … then
else
// vorangehendes Tag bestimmen Flow control: if … thenif i==1 Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
= Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
TEXT
.CropSpaces(Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
) Flow control: if … thenif Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
!="" Numeric functions: log
Numeric functions: loge
Instructions: log
log
Constants: nlnl, « Zeile 1 hat kein Tag: übersprungen» Flow control: if … then
Flow control: try … then
then
Instructions: deldel Buch[i--]; Flow control: nextnext Flow control: if … then
Flow control: try … then
else
PreTag = Vipsi command syntax: Identifiers (names)
Identifiers, names
Operators: Make Identifier "@"
Text functions: name
Glossary: Name, Identifier
name
Buch[i-1] Flow control: if … then
Flow control: try … then
then
// nach Block-Tag: Zeilen ohne Tag werden als Keyword-Liste interpretiert Flow control: if … thenif is_block_tag(PreTag) List functions: split
Instructions: split
split
Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
,"," j=0 Flow control: do … loopdo Flow control: whilewhile ++j <= Numeric functions: countcount Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
keyword = Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
TEXT
.SplitIntoWords(Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
[j]) // List functions: split
Instructions: split
split
into List functions: words
Shell Immediate Commands: words
words
& Separatorsseparators keyword = Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
TEXT
.RemoveOddItems(keyword) // keep List functions: words
Shell Immediate Commands: words
words
keyword = Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
TEXT
.NormalizeName(keyword[to XrefMaxWords]) // normalized_joined_words Flow control: if … thenif keyword!="" Buch[i-1].Keywords ##= keyword Flow control: if … then
Flow control: try … then
then
// store keyword Flow control: do … looploop // <pre> Absatz Flow control: if … thenelif is_pre_tag(PreTag) Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
= Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
TEXT
.CropSpaces_R(Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
) Text functions: convert
Instructions: convert
convert
Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
from @("Constants: tabtab"#TabWidth); // Constants: tabtabs durch spaces ersetzen Buch[i-1].Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
#= Constants: nlnl # Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
[TabWidth+1 to] // <p> Absatz Flow control: if … thenelif is_para_tag(PreTag) Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
= Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
TEXT
.CropSpaces(Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
) Flow control: if … thenif Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
!="" Buch[i-1].Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
#= "<br>" # Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
Flow control: if … then
Flow control: try … then
then
// nach Definition Tag Flow control: if … thenelif is_def_tag(PreTag) Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
= Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
TEXT
.CropSpaces(Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
) Flow control: if … thenif Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
!="" Buch[i-1].Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
#= ", " # Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
Flow control: if … then
Flow control: try … then
then
Flow control: if … then
Flow control: try … then
else
Numeric functions: log
Numeric functions: loge
Instructions: log
log
Constants: nlnl, "List functions: thisthis cannot happen" Flow control: end
Shell Immediate Commands: exit, quit, end
end
Flow control: if … then
Flow control: try … then
then
// Zeile wurde an vorherige angehängt => diese Zeile löschen Instructions: deldel Buch[i--] Flow control: if … then
Flow control: try … then
then
Flow control: do … looploop Flow control: if … thenif verbose Instructions: putput Constants: nlnl, " ", Numeric functions: countcount Buch, " Tags " Flow control: if … then
Flow control: try … then
else
Instructions: putput " " Flow control: if … then
Flow control: try … then
then
Statistics ##= { TagsGesamt = Numeric functions: countcount Buch } // Leerzeilen am Flow control: end
Shell Immediate Commands: exit, quit, end
Ende
von <pre> tags löschen i=0 Flow control: do … loopdo Flow control: whilewhile ++i <= Numeric functions: countcount Buch Flow control: do … loopdo Flow control: whilewhile Text functions: rightstrrightstr(Buch[i].Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
,1)==Constants: nlnl Buch[i].Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
= Buch[i].Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
[ to Numeric functions: countcount(Buch[i].Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
) -1 ] Flow control: do … looploop Flow control: do … looploop // Hierarchie prüfen: Instructions: putput Constants: nlnl, "Hierarchie prüfen " Flow control: if … thenif Vipsi command syntax: Identifiers (names)
Identifiers, names
Operators: Make Identifier "@"
Text functions: name
Glossary: Name, Identifier
name
Buch[1] != "h0" Numeric functions: log
Numeric functions: loge
Instructions: log
log
Constants: nlnl, «Buch beginnt nicht mit Tag "h0"» Numeric functions: log
Numeric functions: loge
Instructions: log
log
Constants: nlnl, "aborted.", Constants: nlnl DumpBuch() Flow control: end
Shell Immediate Commands: exit, quit, end
end
1 Flow control: if … then
Flow control: try … then
then
Instructions: var
How does VScript::Value() work?: Var*&
var
n=Numeric functions: countcount Buch Flow control: do … loopdo Instructions: var
How does VScript::Value() work?: Var*&
var
i = SkipBlock(1) Flow control: whilewhile i<=Numeric functions: countcount Buch Numeric functions: log
Numeric functions: loge
Instructions: log
log
Constants: nlnl, « Tag "»#name Buch[i]#«" hier nicht erlaubt» Instructions: deldel Buch[i] Flow control: do … looploop Flow control: if … thenif n!=Numeric functions: countcount Buch Numeric functions: log
Numeric functions: loge
Instructions: log
log
Constants: nlnl, "aborted.", Constants: nlnl DumpBuch() Flow control: end
Shell Immediate Commands: exit, quit, end
end
1 Flow control: if … then
Flow control: try … then
then
} Instructions: procproc TagsBehandeln() { Instructions: putput Constants: nlnl, "Tags behandeln " // Tags, die einen Anker benötigen, müssen hier ihr Keywords-Element erzeugen Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
TEXT
.SpinCount = 0 Instructions: var
How does VScript::Value() work?: Var*&
var
i=1 Flow control: do … loopdo Flow control: whilewhile i <= Numeric functions: countcount Buch i = Tags.@(Vipsi command syntax: Identifiers (names)
Identifiers, names
Operators: Make Identifier "@"
Text functions: name
Glossary: Name, Identifier
name
Buch[i]).Instructions: readRead(i) Flow control: do … looploop Flow control: if … thenif !verbose Instructions: putput "--> ", Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
TEXT
.SpinCount, " Überschriften" Flow control: if … then
Flow control: try … then
then
} Instructions: procproc BuchAufDateienVerteilen() { Instructions: putput Constants: nlnl, "Buch auf mehrere Dateien verteilen " // Kapitel mit mehr als filesplitsize Zeichen splitten // --> Filesplit anmerken mit Buch[i].List functions: split
Instructions: split
Split
// --> Dateinamen eintragen in Buch[i].Filename // UP: Kapitel Buch[i] kommt in eine eigene Datei // Testen: noch weiter zerlegen? Instructions: procproc split_block(i) { Instructions: var
How does VScript::Value() work?: Var*&
var
Tag = Vipsi command syntax: Identifiers (names)
Identifiers, names
Operators: Make Identifier "@"
Text functions: name
Glossary: Name, Identifier
name
Buch[i] Buch[i] ##= { Filename = NewFilename() } Instructions: var
How does VScript::Value() work?: Var*&
var
j=Numeric functions: findfind("h0h1h2h3h4",Tag) Flow control: if … thenif verbose Instructions: putput Constants: nlnl, " "[to j+1], Buch[i].Filename, " --> ", Buch[i].Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
Flow control: if … then
Flow control: try … then
else
Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
TEXT
.SpinWheel() Flow control: if … then
Flow control: try … then
then
Flow control: if … thenif SizeofBlock(i)<SplitFileSize Flow control: returnreturn SkipBlock(i) Flow control: if … then
Flow control: try … then
then
Instructions: var
How does VScript::Value() work?: Var*&
var
n = NumFiles Instructions: var
How does VScript::Value() work?: Var*&
var
j = i+1 Flow control: do … loopdo Flow control: whilewhile j<Numeric functions: countcount Buch && contains_tag( Tag, Vipsi command syntax: Identifiers (names)
Identifiers, names
Operators: Make Identifier "@"
Text functions: name
Glossary: Name, Identifier
name
Buch[j] ) Flow control: if … thenif Numeric functions: existsexists Buch[j].Keywords j = split_block(j) Flow control: if … then
Flow control: try … then
else
j = SkipBlock(j) Flow control: if … then
Flow control: try … then
then
Flow control: do … looploop Flow control: if … thenif NumFiles>n Buch[i] ##= { List functions: split
Instructions: split
Split
=1 } Flow control: if … then
Flow control: try … then
then
// Flow control: if … then
Flow control: try … then
else
: List functions: split
Instructions: split
Split
n.ex. Flow control: returnreturn j } Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
TEXT
.SpinCount=0 split_block(1) Statistics ##= { HtmlDateien = NumFiles } Flow control: if … thenif verbose Flow control: if … thenif NumFiles == 1 Instructions: putput Constants: nlnl, " Buch besteht aus einer Datei. " Flow control: if … then
Flow control: try … then
else
Instructions: putput Constants: nlnl, " Buch besteht aus ", NumFiles, " Dateien. " Flow control: if … then
Flow control: try … then
then
Flow control: if … then
Flow control: try … then
else
Instructions: putput "--> ", Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
TEXT
.SpinCount, " Dateien" Flow control: if … then
Flow control: try … then
then
} Instructions: procproc AnkerErzeugen() { Instructions: putput Constants: nlnl, "Verweisziele zusammentragen " Instructions: var
How does VScript::Value() work?: Var*&
var
acnt = 0 Instructions: procproc anker_benennen(i,CurrentFile,HeadlineListe) { acnt++ Flow control: if … thenif i!=1 HeadlineListe ##= Buch[i].Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
Flow control: if … then
Flow control: try … then
then
Flow control: if … thenif Numeric functions: countcount HeadlineListe > 2 Instructions: deldel HeadlineListe[1] Flow control: if … then
Flow control: try … then
then
Instructions: var
How does VScript::Value() work?: Var*&
var
f = Numeric functions: existsexists Buch[i].Filename Flow control: if … thenif f Instructions: var
How does VScript::Value() work?: Var*&
var
a = Seed // pro Datei wieder mit "A" beginnen Seed = 0 // fast die Frage, ob der Aufwand lohnt CurrentFile = Buch[i].Filename Flow control: if … then
Flow control: try … then
then
Flow control: try … thentry Instructions: var
How does VScript::Value() work?: Var*&
var
Anker = Buch[i].Anker // falls Ankername vorgegeben wurde Flow control: if … then
Flow control: try … then
else
Instructions: var
How does VScript::Value() work?: Var*&
var
id = Seed++ Instructions: var
How does VScript::Value() work?: Var*&
var
Anker = "" Flow control: do … loopdo Anker #= Text functions: charstrcharstr('A'+id%26) id/=26 Flow control: whilewhile id>=1 Flow control: do … looploop Buch[i] ##= { Anker = Anker } Flow control: if … then
Flow control: try … then
then
Instructions: var
How does VScript::Value() work?: Var*&
var
j=0 Flow control: do … loopdo Flow control: whilewhile ++j <= Numeric functions: countcount Buch[i].Keywords Flow control: if … thenif Numeric functions: countcount HeadlineListe>=2 Instructions: var
How does VScript::Value() work?: Var*&
var
hl = Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
TEXT
.JoinText(HeadlineListe,": ") Flow control: if … thenelif Numeric functions: countcount HeadlineListe==1 Instructions: var
How does VScript::Value() work?: Var*&
var
hl = HTML.B(HeadlineListe[1]) Flow control: if … then
Flow control: try … then
else
Instructions: var
How does VScript::Value() work?: Var*&
var
hl = HTML.B(Buch[1].Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
) /* Buchtitel */ Flow control: if … then
Flow control: try … then
then
AddXref( Buch[i].Keywords[j], hl, CurrentFile, Anker ) Flow control: do … looploop Instructions: var
How does VScript::Value() work?: Var*&
var
Tag = Vipsi command syntax: Identifiers (names)
Identifiers, names
Operators: Make Identifier "@"
Text functions: name
Glossary: Name, Identifier
name
Buch[i] Instructions: var
How does VScript::Value() work?: Var*&
var
j = i+1 Flow control: do … loopdo Flow control: whilewhile j <= Numeric functions: countcount Buch Flow control: whilewhile contains_tag(Tag,Vipsi command syntax: Identifiers (names)
Identifiers, names
Operators: Make Identifier "@"
Text functions: name
Glossary: Name, Identifier
name
Buch[j]) Flow control: if … thenif Numeric functions: existsexists Buch[j].Keywords j = anker_benennen(j,CurrentFile,HeadlineListe) Flow control: if … then
Flow control: try … then
else
j = SkipBlock(j) Flow control: if … then
Flow control: try … then
then
Flow control: do … looploop Flow control: if … thenif f Buch[i] ##= { Seed=Seed } // --> für IDs der Multilink-Popups Seed = a Flow control: if … then
Flow control: try … then
then
Flow control: returnreturn j } anker_benennen(1,"",{}) Statistics ##= { AnzahlAnker=acnt, AnzahlKeywords=Numeric functions: countcount Xref } } Instructions: procproc QuerverweiseEinfügen() { Instructions: putput Constants: nlnl, "Querverweise einfügen " /* UP: Text functions: link
Instructions: link
Links
in eine Zeile einfügen in: Zeile liegt als Wortliste {Sep,Wort,...Sep} vor aktuelle Wortzahl für Keyphrase-Suche EigeneDatei -> Urls ohne Dateinamen out: Zeile als Wort-Liste */ Instructions: var
How does VScript::Value() work?: Var*&
var
xrefs=0 Instructions: var
How does VScript::Value() work?: Var*&
var
xref={0,0,0,0,0,0,0,0,0,0,0,0}[to XrefMaxWords] Instructions: procproc add_refs ( Wortliste/*Zeile*/, Wortzahl/*Keyphrase*/, EigeneDatei/*wg.Text functions: link
Instructions: link
Link
*/ ) { // Instructions: putput Constants: nlnl, Wortliste Instructions: var
How does VScript::Value() work?: Var*&
var
Worte = {} // => Keyphrase Instructions: var
How does VScript::Value() work?: Var*&
var
e_worte=0 // Worte <=> Wortliste[ a_worte to e_worte ] Instructions: var
How does VScript::Value() work?: Var*&
var
a_worte=2 // sliding-window such nach Such-Phrasen in Anker-Liste Flow control: do … loopdo // erste Suchphrase basteln / Suchphrase komplettieren Flow control: if … thenif Numeric functions: countcount Worte < Wortzahl e_worte += 2 Flow control: if … thenif e_worte > Numeric functions: countcount Wortliste Flow control: returnreturn Wortliste Flow control: if … then
Flow control: try … then
then
Flow control: if … thenif Wortliste[e_worte][1]=="<" && HTML.IsAnyTag(Wortliste[e_worte]) Worte = {} // avoid tag interleaving: <Text functions: link
Instructions: link
link
> .. <tag> .. </Text functions: link
Instructions: link
link
> .. </tag> a_worte = e_worte+2 // ***TODO***: <Text functions: link
Instructions: link
link
> .. <tag> .. </tag> .. </Text functions: link
Instructions: link
link
> is possible for certain tags Flow control: nextnext Flow control: if … then
Flow control: try … then
then
Worte ##= Wortliste[e_worte] Flow control: nextnext Flow control: if … then
Flow control: try … then
then
// suchen: Instructions: var
How does VScript::Value() work?: Var*&
var
Keyphrase = Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
TEXT
.NormalizeName(Worte) Instructions: var
How does VScript::Value() work?: Var*&
var
Ankerliste = FindXref(Keyphrase) Flow control: if … thenif Numeric functions: countcount Ankerliste == 0 // no Numeric functions: matchmatch a_worte += 2 Instructions: deldel Worte[1] Flow control: nextnext Flow control: if … then
Flow control: try … then
then
xrefs++ xref[Wortzahl]++ // Einträge in Ankerliste umschrumpeln: // <url>={Label=<label>, Text functions: file
Instructions: file
File
=<Text functions: file
Instructions: file
file
>, Anker=<anker>} --> { Label=<label>, Url=<url> } Instructions: var
How does VScript::Value() work?: Var*&
var
i=0 Flow control: do … loopdo Flow control: whilewhile ++i <= Numeric functions: countcount Ankerliste Instructions: renamerename Ankerliste[i].Text functions: file
Instructions: file
File
= "Url" Flow control: if … thenif Ankerliste[i].Url == EigeneDatei Ankerliste[i].Url = "" Flow control: if … then
Flow control: try … then
then
Ankerliste[i].Url #= "#" # Ankerliste[i].Anker Flow control: do … looploop Flow control: if … thenif verbose Instructions: putput verbose >=2 ? "<"#Keyphrase#":"#count Ankerliste#">" : Wortzahl#Numeric functions: countcount Ankerliste#" " Flow control: if … then
Flow control: try … then
else
Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
TEXT
.SpinWheel() Flow control: if … then
Flow control: try … then
then
// List functions: join
Instructions: join
join
List functions: words
Shell Immediate Commands: words
words
=> Text functions: link
Instructions: link
Link
darf nicht mehr zerbrochen werden Wortliste[a_worte] = Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
TEXT
.JoinText(Wortliste[a_worte to e_worte]) Flow control: do … loopdo Flow control: whilewhile e_worte>a_worte Instructions: deldel Wortliste[e_worte--] Flow control: do … looploop // whole Text functions: link
Instructions: link
link
:= one single List functions: words
Shell Immediate Commands: words
word
! Wortliste[a_worte] = Style.Linklist(Wortliste[a_worte],Ankerliste) a_worte += 2 Worte = {} Flow control: do … looploop } /* Text functions: link
Instructions: link
Links
in alle Textzeilen ((p_tags)) einfügen Blocktags rekursiv abarbeiten. */ Instructions: procproc QuerverweiseEinfügen ( i, CurrentFile ) { // neues Text functions: file
Instructions: file
file
=> IDs für multiankertags können wieder bei 0 beginnen Instructions: var
How does VScript::Value() work?: Var*&
var
f = Numeric functions: existsexists Buch[i].Filename Flow control: if … thenif f Instructions: var
How does VScript::Value() work?: Var*&
var
OLDseed = Seed Seed = Buch[i].Seed // von Anker-Nummerierung gesetzt CurrentFile = Buch[i].Filename Flow control: if … then
Flow control: try … then
then
Instructions: var
How does VScript::Value() work?: Var*&
var
Tag = Vipsi command syntax: Identifiers (names)
Identifiers, names
Operators: Make Identifier "@"
Text functions: name
Glossary: Name, Identifier
name
Buch[i] Instructions: var
How does VScript::Value() work?: Var*&
var
j = i+1 Flow control: do … loopdo Flow control: whilewhile j <= Numeric functions: countcount Buch Instructions: var
How does VScript::Value() work?: Var*&
var
Subtag = Vipsi command syntax: Identifiers (names)
Identifiers, names
Operators: Make Identifier "@"
Text functions: name
Glossary: Name, Identifier
name
Buch[j] Flow control: whilewhile contains_tag(Tag,Subtag) // PARA + PRE tags => Querverweise einfügen Flow control: if … thenif is_para_tag(Subtag) || is_pre_tag(Subtag) Instructions: var
How does VScript::Value() work?: Var*&
var
Zeile = Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
TEXT
.SplitIntoWords(Buch[j].Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
) // -> { sep, List functions: words
Shell Immediate Commands: words
word
, sep, ... sep } Instructions: var
How does VScript::Value() work?: Var*&
var
Worte = XrefMaxWords Flow control: do … loopdo Zeile = add_refs ( Zeile, Worte, CurrentFile ) Flow control: whilewhile --Worte Flow control: do … looploop Buch[j++].Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
= Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
TEXT
.JoinText( Zeile ) Flow control: if … then
Flow control: try … then
else
j = QuerverweiseEinfügen(j,CurrentFile) Flow control: if … then
Flow control: try … then
then
Flow control: do … looploop // zurück zum alten Text functions: file
Instructions: file
file
=> zurück zum alten Seed Flow control: if … thenif f Buch[i].Seed = Seed Seed = OLDseed Flow control: if … then
Flow control: try … then
then
Flow control: returnreturn j } Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
TEXT
.SpinCount=0 QuerverweiseEinfügen(1,"") Flow control: if … thenif !verbose Instructions: putput "--> ", Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
TEXT
.SpinCount, " Querverweise" Flow control: if … then
Flow control: try … then
then
Statistics ##= { AnzahlQuerverweise=xrefs, QuerverweiseNachWortzahl=xref } } /* ******************************************************************** SCHREIBE DATEIEN ******************************************************************** */ /* ---- Erstelle alle Dateien für ein Kapitel -------------------- Kapitelhierarchie = Buch-Index-Liste der übergeordneten Kapitel */ Instructions: procproc SchreibeKapitel ( i, Kapitelhierarchie ) { Flow control: if … thenif verbose Instructions: putput Constants: nlnl," "[to 2+2*Numeric functions: countcount Kapitelhierarchie],Buch[i].Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
," " Flow control: if … then
Flow control: try … then
else
Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
TEXT
.SpinWheel() Flow control: if … then
Flow control: try … then
then
Kapitelhierarchie ##= i // Template lesen Instructions: var
How does VScript::Value() work?: Var*&
var
List functions: split
Instructions: split
Split
= Numeric functions: existsexists Buch[i].List functions: split
Instructions: split
Split
Flow control: if … thenif i == 1 Instructions: var
How does VScript::Value() work?: Var*&
var
PageData = Template.Numeric functions: indexIndex Flow control: if … thenelif List functions: split
Instructions: split
Split
Instructions: var
How does VScript::Value() work?: Var*&
var
PageData = Template.List functions: split
Instructions: split
Split
Flow control: if … then
Flow control: try … then
else
Instructions: var
How does VScript::Value() work?: Var*&
var
PageData = Template.Page Flow control: if … then
Flow control: try … then
then
// TITLE Tag: Instructions: var
How does VScript::Value() work?: Var*&
var
HL = {} Instructions: var
How does VScript::Value() work?: Var*&
var
j=0 Flow control: do … loopdo Flow control: whilewhile ++j <= Numeric functions: countcount Kapitelhierarchie HL ##= Buch[Kapitelhierarchie[j]].Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
Flow control: do … looploop Text functions: replace
Instructions: replace
replace
PageData, "%%TITLE%%", Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
TEXT
.JoinText(HL,": ") // Keywords Meta Tag: Text functions: replace
Instructions: replace
replace
PageData, "%%KEYWORDS%%", Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
TEXT
.JoinText(HL,", ") // H0 (Buchtitel), H1 .. H6 Instructions: var
How does VScript::Value() work?: Var*&
var
j = 0 Flow control: do … loopdo Flow control: whilewhile ++j <= 7 Text functions: replace
Instructions: replace
replace
PageData, "%%HEADLINE"#(j-1)#"%%", j <= Numeric functions: countcount Kapitelhierarchie ? Style.Headline(Kapitelhierarchie[j]) : "" Flow control: do … looploop // [<prev] [Flow control: nextnext>] buttons Text functions: replace
Instructions: replace
replace
PageData, "%%PREV%%", PrevFilename(Buch[i].Filename) Text functions: replace
Instructions: replace
replace
PageData, "%%Flow control: nextNEXT%%", NextFilename(Buch[i].Filename) Instructions: var
How does VScript::Value() work?: Var*&
var
Flow control: end
Shell Immediate Commands: exit, quit, end
End
= SkipBlock(i) Instructions: var
How does VScript::Value() work?: Var*&
var
Tag = Vipsi command syntax: Identifiers (names)
Identifiers, names
Operators: Make Identifier "@"
Text functions: name
Glossary: Name, Identifier
name
Buch[i] // TOC Instructions: var
How does VScript::Value() work?: Var*&
var
TocText = {} Instructions: var
How does VScript::Value() work?: Var*&
var
j = i+1 Flow control: do … loopdo Flow control: whilewhile j < Flow control: end
Shell Immediate Commands: exit, quit, end
End
Flow control: if … thenif Numeric functions: existsexists Buch[j].Keywords TocText ##= Style.TocItem(j) Flow control: if … then
Flow control: try … then
then
j = SkipBlock(j) Flow control: do … looploop Text functions: replace
Instructions: replace
replace
PageData, "%%TOC%%", Style.Toc(i,TocText) // Preface, Body Instructions: var
How does VScript::Value() work?: Var*&
var
F = 3 + Numeric functions: countcount Kapitelhierarchie Instructions: openoutopenout #F, TargetDir#Buch[i].Filename Instructions: putput #F, PageData[to Numeric functions: findfind(PageData,"%%BODY%%")-1] Instructions: var
How does VScript::Value() work?: Var*&
var
j=i+1 Flow control: do … loopdo Flow control: whilewhile j < Flow control: end
Shell Immediate Commands: exit, quit, end
End
Instructions: var
How does VScript::Value() work?: Var*&
var
Subtag = Vipsi command syntax: Identifiers (names)
Identifiers, names
Operators: Make Identifier "@"
Text functions: name
Glossary: Name, Identifier
name
Buch[j] Flow control: if … thenif Numeric functions: existsexists Buch[j].Filename j = SchreibeKapitel( j, Kapitelhierarchie ) Flow control: if … then
Flow control: try … then
else
j = Tags.@Subtag.Instructions: writeWrite(F,j) Flow control: if … then
Flow control: try … then
then
Flow control: do … looploop Instructions: putput #F, PageData[Numeric functions: findfind(PageData,"%%BODY%%")+8 to] Instructions: closeclose #F Flow control: returnreturn Flow control: end
Shell Immediate Commands: exit, quit, end
End
} Instructions: procproc BuchNachHtmlKonvertieren() { Instructions: putput Constants: nlnl, "Nach Html konvertieren " Instructions: var
How does VScript::Value() work?: Var*&
var
i=0 Flow control: do … loopdo Flow control: whilewhile ++i <= Numeric functions: countcount Buch Flow control: try … thentry Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
TEXT
.SpinWheel() Buch[i].Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
= HTML.ConvertToHtml(Buch[i].Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
Text
) Flow control: if … then
Flow control: try … then
else
Numeric functions: log
Numeric functions: loge
Instructions: log
log
Constants: nlnl,"[",Vipsi command syntax: Identifiers (names)
Identifiers, names
Operators: Make Identifier "@"
Text functions: name
Glossary: Name, Identifier
name
Buch[i],"] ",errorstr Flow control: if … then
Flow control: try … then
then
Flow control: do … looploop Instructions: putput " " // remove SpinWheel } Instructions: procproc AlteDateienLöschen() { Instructions: putput Constants: nlnl,"Lösche alte Dateien " Instructions: var
How does VScript::Value() work?: Var*&
var
i=0 Flow control: do … loopdo Instructions: var
How does VScript::Value() work?: Var*&
var
dir: fnamefname = TargetDir # FilenameFromIndex(++i) Flow control: whilewhile Numeric functions: existsexists Text functions: file
Instructions: file
file
dir: fnamefname Flow control: if … thenif verbose Instructions: putput "*" Flow control: if … then
Flow control: try … then
else
Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
TEXT
.SpinWheel() Flow control: if … then
Flow control: try … then
then
Instructions: deldel Text functions: file
Instructions: file
file
dir: fnamefname Flow control: do … looploop Instructions: putput " " // remove SpinWheel } Instructions: procproc BuchdateienSchreiben() { Instructions: putput Constants: nlnl,"Schreibe Buch-Dateien " // Template.Numeric functions: indexIndex Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
and
Template.List functions: split
Instructions: split
Split
default to Template.Page Flow control: if … thenif !Numeric functions: existsexists Template.Numeric functions: indexIndex Template ##= { Numeric functions: indexIndex = Template.Page } Flow control: if … then
Flow control: try … then
then
Flow control: if … thenif !Numeric functions: existsexists Template.List functions: split
Instructions: split
Split
Template ##= { List functions: split
Instructions: split
Split
= Template.Page } Flow control: if … then
Flow control: try … then
then
Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
TEXT
.SpinCount=0 SchreibeKapitel ( 1, {} ) Flow control: if … thenif !verbose Instructions: putput "--> ", Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
TEXT
.SpinCount, " Dateien" Flow control: if … then
Flow control: try … then
then
} Instructions: procproc DumpBuch() { Instructions: var
How does VScript::Value() work?: Var*&
var
B=4 Instructions: openoutopenout#B,"Buch.txt" Numeric functions: log
Numeric functions: loge
Instructions: log
log
"%" Instructions: var
How does VScript::Value() work?: Var*&
var
z = Data Types: Text
Text functions: string
string
(Buch) Numeric functions: log
Numeric functions: loge
Instructions: log
log
"%" Text functions: replace
Instructions: replace
replace
z,"}, ","},\n" Numeric functions: log
Numeric functions: loge
Instructions: log
log
"%" Text functions: replace
Instructions: replace
replace
z,«", »,«",\n» Numeric functions: log
Numeric functions: loge
Instructions: log
log
"%" Instructions: putput#B,z,Constants: nlnl Numeric functions: log
Numeric functions: loge
Instructions: log
log
"%" Instructions: closeclose#B } Instructions: procproc DumpXref() { Instructions: var
How does VScript::Value() work?: Var*&
var
X=4 Instructions: openoutopenout#X,"Xref.txt" Instructions: var
How does VScript::Value() work?: Var*&
var
z = Data Types: Text
Text functions: string
string
(Xref) Text functions: replace
Instructions: replace
replace
z,"}, ","},\n" Text functions: replace
Instructions: replace
replace
z,«", »,«",\n» Instructions: putput#X,z,Constants: nlnl Instructions: closeclose#X } Instructions: procproc DumpGlobals() { Instructions: var
How does VScript::Value() work?: Var*&
var
G=4 Instructions: openoutopenout#G,"List functions: globals
Shell Immediate Commands: globals
globals
.txt" Instructions: var
How does VScript::Value() work?: Var*&
var
z = Data Types: Text
Text functions: string
string
List functions: globals
Shell Immediate Commands: globals
globals
Text functions: replace
Instructions: replace
replace
z,"}, ","},\n" Text functions: replace
Instructions: replace
replace
z,«", »,«",\n» Instructions: putput#G, z, Constants: nlnl Instructions: closeclose#G } Instructions: procproc Doit() { QuelltextEinlesen() ÄnderungsdatumPrüfen() TagsAbtrennen() TagsBehandeln() BuchAufDateienVerteilen() AnkerErzeugen() QuerverweiseEinfügen() BuchNachHtmlKonvertieren() AlteDateienLöschen() BuchdateienSchreiben() StatisticsAnzeigen() } Functions with varying return types: include
Instructions: include
include
LibDir # "HTML.vl" Functions with varying return types: include
Instructions: include
include
LibDir # "Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
TEXT
.vl" /* ****************************************************************************** MAIN DATA: "DAS BUCH" ****************************************************************************** */ Instructions: var
How does VScript::Value() work?: Var*&
var
Buch = "" Flow control: end
Shell Immediate Commands: exit, quit, end
end
0

Valid HTML   Valid CSS