type

type — creates macro-like definitions.

Synopsis

       
(type name command args ...)
	

Parameters

name

A new symbol name for the type definition.

command

The command to be invoked by name.

args ...

The arguments to the command as they would normally be used. Argument substitution is available by using %i as one of the args in the definition, where i is the ith argument in the calling argument list.

Returns

OK or (error).

Description

This command gives you a way of creating macro-like definitions, which facilitates repetitive configuration commands, such as when defining points.

Example

In the following example, we define the command AI to facilitate creating analog input points (see analog). When the AI command is used, the first argument is substituted for the %1 in the type definition, which is the point name argument of the analog command. The second argument is substituted for the address argument and the third for the eng_unit_max argument of that same command.

(type AI analog t %1 %2 r 0 t 0 32767 0 %3)
(AI Volume-Control 0:0 100)
(AI Feedback 0:2 0)