contentsconceptssyntaxlibrariessampleserrorsindex
Full text search
Local variables: declaring
Prerequisite Concepts     Related Syntax  

Local variable declarations are declared at the beginning of a local scope. In a rule, a local scope always begins immediately after the rule header, and ends immediately before the next rule, declaration, function definition, or macro definition. Thus, local variable declarations can appear before the actions in a rule.

If the name of a local variable is the same as an OmniMark keyword, that keyword loses its meaning for the entire local scope. This includes any declarations that precede the local variable declaration. (For example, this means that the name local cannot be used for a local variable.) This behavior can be changed with the declare heralded-names declaration.

No local variable can have the same name as another local variable in the same local scope. A common practice is to give the same name to two local variables in two different rules. This is allowed because the two declarations will be in different local scopes. This restriction can be changed with the declare heralded-names declaration.

The following are examples of local variable declarations:

  find-start
    local stream tmp
    local counter sum

Prerequisite Concepts
     Variables
 
  Related Syntax
   global, local
 
----

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

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

Copyright © OmniMark Technologies Corporation, 1988-1999.