Zonk currently has the following accessable internal variables. Note that some of them take an additional parameter. Also note that all internal variable return <i>strings</i> unless a <ref genc>treatas</r> modifier follows. With the exception of <lit>%pullfile</lit>, all these variables are 'static' (although their values may change they only have one value at any one time).
<dl>
<dt>%pagenum <dd>the current pagenumber. Incremented by one as each $<lit>endpage:</lit> in a datafile is passed.
<dt>%imgsize <var>filename</var> <dd>attempts to read <var>filename</var> as a GIF or JPEG and if successful will return a string of the form <lit>width=123 height=456</lit>. If it fails for any reason the string will contain some details of the error. Designed for use inside html img tags of course.
<dt>%imglastwidth <dd>returns the width of the last image file passed to <lit>%imgsize</lit> or zero if there was an error.
<dt>%imglastheight <dd>returns the height of the last image file passed to <lit>%imgsize</lit> or zero if there was an error.
<dt>%now <dd>the current time and date in the format <lit>Wed Feb 3 17:42:12 1999</lit> (ctime() format in case you're interested). Use with a date <ref fstrin>formatstring</r> if you wish to reformat it and remember to reference it as %now@.
<dt>%countof <var>variablename</var> <dd>returns the current total number of definitions for a given variable. It can by used with static variables but of course will always return 1.
<dt>%id <var>variablename</var> <dd>returns the number of the definition for a variable that is currently accessible numebering them from 1.
</dl>
Note with both of the above that if you want to treat them as integers the form is %id# <var>variablename</var> and *not* %id <var>variablename</var># .Also note that, for multipage datafiles, the numbers returned refer to the number of definitions on the current page only and not the whole file.
<dl>
<dt>%length <var>variablename</var> <dd>returns the length of the string value of the <var>variablename</var>. Useful for checking for defined but empty values e.g. (%length fred .eq 0)
<dt>%progdir <dd>Zonk's program directory
<dt>%outfile <dd>The name of the current output file
<dt>%template <dd>The name of the current template
<dt>%datafile <dd>The name of the current datafile
<dt>%globalfile <dd>The name of the current globalfile (if any)
<dt>%pulltot <dd>The total number of pullouts in a datafile
<dt>%pullfile <dd>A dynamic variable with one definition for each $pullout file used.
</dl>
The following internal variables only have meaning whilst inside a $pullout file
<dl>
<dt>%pullprev <dd>The name of the previous pullout file processed
<dt>%pullnext <dd>The name of the next pullout file to process
<dt>%pullnum <dd>The current $pullout number (counting the first $pullout in a datafile as 1)