contentsconceptssyntaxlibrariessampleserrorsindex
Full text search
Functions: the differences between value and read-only arguments
Prerequisite Concepts     Related Syntax  

The fundamental difference between value and read-only arguments is that a value argument is used to pass the result of a single expression, and read-only is used to pass an entire shelf.

Use a value argument when:

Use a read-only argument when a shelf is being passed as an argument and:

In general, if none of the conditions that require a read-only argument apply, then it is probably better to make the argument a value argument.

This sample shows how to use a read-only argument to count the number of active switch values on a switch shelf, without modifying the shelf.

  define counter function count-active-switches
                          (read-only switch switch-shelf) as
     local counter active-count
     set active-count to 0
     repeat over switch-shelf
        increment active-count when switch-shelf
     again
     return active-count

Prerequisite Concepts
     Functions
   Functions: argument classes
 
  Related Syntax
   define function
   value
 
----

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

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

Copyright © OmniMark Technologies Corporation, 1988-1999.