procedure
A function to conduct a dialogue with a server channel. <command_block> is a block of language commands, any of which starting with an * are sent to the server channel, as though by a write command. Any errors detected during execution of the command block (language errors or errors reported by the server) will abort the command block.
Within server commands which require identifier values, language identifiers may be specified by preceding them with a : character, e.g.
string s = '/home/tmp/acad/fn1678g.dxf' *open :s
Such language variables may be array expressions. They must not contain any embedded white space. The only permitted identifier types are numeric, string, time and point. An attempt to output other variables will produce an error. Colons within quoted strings are treated literally and are not assumed to prefix a language variable. Numeric values will be expanded without trailing zeros, string variables will be enclosed within quotes, time variables will be output using the current date_mode format, point variables will be output in the form (x,y,z).
If the procedure is passed a numeric parameter whose value is non-zero, the command block is executed in "abort mode" meaning that any errors detected by the server aborts the block, i.e. skips the remaining commands in the block. The channel is not closed by this abort operation.
Whenever the server detects an error, the attribute channel.serverr is set to a non-zero value. If the channel dies during execution of the block channel.serverr is set to -1 and the command block aborts if executing in abort mode.
This element is applicable only to server channels.
The code of the procedure cannot be redefined.
channel.session() { <command_block> }
The procedure may be called in one of two ways:
# Assume mychan is the channel identifier. channel.session(mychan)
or
mychan.session()
Open a server channel to the Autocad file translator. Within a channel session attempt to import three files. If any one of the imports fails the block is aborted.
open ch,-s='fxacad' ch.session { * open f1.dxf * objfetch * open f2.dxf * objfetch * open f3.dxf * objfetch } box; plan if (ch.serverr) !Could not load all files ch.close
Identifiers: |
date_mode (numeric) |
Structures: |