contentsconceptssyntaxlibrariessampleserrorsindex
Full text search
action   set    
  Related Syntax   Related Concepts  

Syntax

  set (variable-type? variable-name indexer?) | (file file-name) to value
  OR
  set stream-output-function-call open-modifiers to string-expression 


Purpose

You use set to assign a value to a variable. set replaces the value of a variable with the new value:

  set my-stream to "Mary had a little lamb."
  set my-counter to 78
  set my-switch to true
  set referant "my-referant" to "Its fleece was white as snow."
  set my-float to fp_v "10.56"

You can also use set to read and write files:

  set file "mary.txt" to my-buffer
  set my-buffer to file "mary.txt"
  set file "mary.txt" to file "lamb.txt"

When used with streams, set is equivalent to opening the stream, writing to it, then closing it. For this reason, any modifiers that can be used with open can also be used with set:

  set my-stream with referents-allowed defaulting {""}
      to "Mary had a little lamb."
  set file "mary.txt" with referents-displayed
      to my-stream

You can also use set to provide input to an external output function :

  set my-external-function to "Mary had a little lamb"

    Related Syntax
   set creator of
   new, set new
   set stream
   set buffer
   set key of
   set file
   set referent
   set external-function
   set function-library of external-function
 
Related Concepts
   I/O and variables
   Referents: default definitions for a reopened stream
   Referents: writing referents to a stream
   Security considerations
 
----

Top [CONTENTS] [CONCEPTS] [SYNTAX] [LIBRARIES] [SAMPLES] [ERRORS] [INDEX]

Generated: April 21, 1999 at 2:01:15 pm
If you have any comments about this section of the documentation, send email to [email protected]

Copyright © OmniMark Technologies Corporation, 1988-1999.