swirl
Guide to OmniMark 8   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
     
action  

void

 
 

Syntax

void expression


Purpose

The void action is used to evaluate an expression, but to throw away the resulting value. This is useful when the expression has side-effects that are desired, but the actual value generated by the expression is of no interest.

expression must be an expression of an unqualified type: that is, integer, string, switch, an opaque type, or a record type. If expression is of type string source, it is first implicitly converted to a string; this drains expression.

Although expression can be any expression of an unqualified type, the most common use of void is when expression contains a function call.

Example

OmniMark's system-call operator executes an operating system command, and returns the integer return code from the command. This code is often of little interest. Rather than writing

       process
          local integer i
  
          set i to system-call "<operating system command>"

which generates a warning (because the shelf I is assigned a value but never used), the following can be written

       process
          void system-call "<operating system command>"

       
 

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ LEGACY LIBRARIES ] [ ERRORS ]

OmniMark 8.2.0 Documentation Generated: March 13, 2008 at 3:33:48 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2008.