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

  1. $zonkpage 1.07
  2.  
  3. title: Read and Reset
  4.  
  5. text:{<sh>Read - syntax</sh>
  6.  
  7. <lit><zonk read <var>variablename</var> [<var>variablename</var>...]></lit> 
  8.  
  9. <sh>Description</sh>
  10.  
  11. The currently accessable value of the variable(s) named is set to the next definition of the variable in its list of values. If you are already accessing the last definition when a read is executed then the value becomes NULL. If the mode of a variable read is 'either' it is forced to 'dynamic'. If an attempt is made to read a 'static' variable the command will fail. Using multiple variable names with read is just a shorthand for <zonk read VAR1> <zonk read VAR2> etc.
  12.  
  13. Just a quick reminder here that when using a dynamic variable to control a <ref cwhil>while loop</r>, an implicit read is done on that variable everytime the corresponding <lit>endwhile</lit> is reached.
  14.  
  15. <sh>Examples</sh>
  16.  
  17. Given the variable definitions:
  18.  
  19. <lit>town: London
  20. town: Birmingham
  21. town: Manchester</lit> 
  22.  
  23. The following commands:
  24.  
  25. <lit><zonk read town>
  26. <zonk tagvalue town>
  27. <zonk read town>
  28. <zonk tagvalue town>
  29. <zonk read town>
  30. <zonk tagvalue town></lit> 
  31.  
  32. would result in the output:
  33.  
  34. <lit>Birmingham
  35. Manchester
  36. *** no value for 'town' ***</lit> 
  37.  
  38. The value 'London' is not printed as a variable is always pointing to its first value before it is used. Therefore the first read skips over London. Similarly, when the third read is encountered above there are no more values for town so the output html would contain an error message similar to the one above. Remember that if you wish to suppress the error you can use the 'failok' option with <ref ctagv>tagvalue</r>.
  39.  
  40. <a name="reset"></a><sh>Reset - syntax:</sh>
  41.  
  42.  
  43. <lit><zonk reset <var>variablename</var> [<var>variablename</var>...]></lit> 
  44.  
  45. <sh>Description</sh>
  46.  
  47. As for read except the currently accessable value for each variable specified is set back to the first definition on the current 'page' of the datafile.
  48.  
  49. <sh>Example</sh>
  50.  
  51. Given the variable definitions of 'town' above then:
  52.  
  53. <lit><zonk read town>
  54. <zonk tagvalue town>
  55. <zonk reset town>
  56. <zonk tagvalue town></lit> 
  57.  
  58. would result in the output:
  59.  
  60. <lit>Birmingham
  61. London</lit> 
  62.