home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / programs / comms_networking / zonk / rawdocs / intvar < prev    next >
Encoding:
Text File  |  1999-02-13  |  2.9 KB  |  57 lines

  1. $zonkpage 1.07
  2.  
  3. $usetemplate: tpl.cmd/tpl
  4.  
  5. title: Appendix A - Internal variable list
  6.  
  7. text:{
  8.  
  9. 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).
  10.  
  11. <dl>
  12. <dt>%pagenum <dd>the current pagenumber. Incremented by one as each $<lit>endpage:</lit> in a datafile is passed.
  13.  
  14. <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.
  15.  
  16. <dt>%imglastwidth <dd>returns the width of the last image file passed to <lit>%imgsize</lit> or zero if there was an error.
  17.  
  18. <dt>%imglastheight <dd>returns the height of the last image file passed to <lit>%imgsize</lit> or zero if there was an error.
  19.  
  20. <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@.
  21.  
  22. <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.
  23.  
  24. <dt>%id <var>variablename</var> <dd>returns the number of the definition for a variable that is currently accessible numebering them from 1.
  25.  
  26. </dl>
  27. 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.
  28.  
  29. <dl>
  30. <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)
  31.  
  32. <dt>%progdir <dd>Zonk's program directory
  33.  
  34. <dt>%outfile <dd>The name of the current output file
  35.  
  36. <dt>%template <dd>The name of the current template
  37.  
  38. <dt>%datafile <dd>The name of the current datafile
  39.  
  40. <dt>%globalfile <dd>The name of the current globalfile (if any)
  41.  
  42. <dt>%pulltot <dd>The total number of pullouts in a datafile
  43.  
  44. <dt>%pullfile <dd>A dynamic variable with one definition for each $pullout file used.
  45. </dl>
  46.  
  47. The following internal variables only have meaning whilst inside a $pullout file
  48.  
  49. <dl>
  50.  
  51. <dt>%pullprev <dd>The name of the previous pullout file processed
  52.  
  53. <dt>%pullnext <dd>The name of the next pullout file to process
  54.  
  55. <dt>%pullnum <dd>The current $pullout number (counting the first $pullout in a datafile as 1)
  56. </dl>
  57.