swirl
Guide to OmniMark 7   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Syntax    
operator  

system-call

 

 

Return type: Integer
Returns:       

The numeric value of the command from the system.



Syntax
  system-call string-expression


Purpose

Allows an operating-system-specific command to be executed in an OmniMark program.This operator must be followed by a string expression that contains a system-specific command. system-call invokes that command and returns the numeric result code returned by that command when it completes its task.

Because the system-call operator returns a numeric value, it must be used in a context where a numeric expression is required. The string expression contains the name of the program to run, as well as any command-line arguments that are being passed to it.

The function being provided by system-call and the value it returns depends on the system on which OmniMark is running. The built-in stream #platform-info can supply some of this information.

In this example, an editing session is called with the name of the file to edit. After the system-call is made, a check for a negative value is made, which presumably means that the editor, "sled", could not be found. Note that because the system-call is made from a condition, it occurs before the output action actually takes place.

  find "\input{" any++ => file-name "}"
    output "couldn't start the sled editor%n"
          when system-call "sled %g(file-name)" < 0

    Related Syntax
   #platform-info
 
 
 

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

OmniMark 7.1.2 Documentation Generated: June 28, 2005 at 5:45:48 pm
If you have any comments about this section of the documentation, send email to [email protected]

Copyright © Stilo Corporation, 1988-2005.