ArborX


tokloop

Longname: tokloop en loop   Open the Documentation Legend
Released: 7.80 
Created: 7.80 
See also: var attr stream mini getvar indirect (n/a) expr show xpath attrloop measure xpointer fs fish fishloop prop propval length lookup resolve string perl lump_expand hash taginfo format_num format_seq css char Technote: 0080

Summary
A keyword used with function variables: ^[funcname parameter(s)]. This syntax can be used anywhere that a regular 3B2 variable can be used: in show strings, in scripts, in expressions, etc. Function variables are a V8 feature that uniforms variable use and functions into a readable syntax. The 'tokloop' function similar to 'attrloop', extracts a tags attribute value into segments called attribute tokens. These are selections of the total value segmented by spaces and being asigned a number value from left to right.
Example extract

The following show string will display the current value of the th command (text height).

 <?show ^[prop th]?>

Syntax (7.80)
tokloop token:n
token:n

Number of the attributes value token you wish to call.

The first method uses the original tokenloop syntax and the second uses the function variable syntax.

When the stream contains;

 <section idref="This is section 28" date="2004 11 17">...]

And the 'section' tag contains;

 <@{> 1
 <@idref> 2
 <?show $^@@(2)> 3
 <@}> 4
  5
 <@{> 6
 <@date> 7
 <?show $^[tokloop 2]> 8
 <@}> 9

The tokloop call in 'idref' would have a value of 'is', and the 'date' call would be '11'.


Document created on 01-Oct-2004 (revision 1)