swirl
Guide to OmniMark 8   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
    Related Concepts  
control structure  

using input as

 
 

Syntax

using input as source expression
    block


Purpose

You can use using input as to establish a new current input scope without actually initiating scanning of the data source belonging to that scope. This is useful if you want to establish the input scope in which a function will be called, or if you want to establish a single source on which you will perform a number of scanning operations in succession.

The following code uses using input as to establish the input scope for a function:

  define integer function sum-of-csv
      as
      local integer sum initial {0}
      repeat scan #current-input
          match white-space* 
                digit+ => number
                white-space*
                ","?
              set sum to sum + number
      again              
      return sum
  
  process
     local integer total
     using input as file "numbers.csv"
      set total to sum-of-csv

      Related Concepts
   String source data type
 
 

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.