
7 RASExpress Script Language
CommPlete Communications Server 163
CONNECTED connected : integer;;
Indicates if a connection is initialized. If a connection is initialized, 1 is returned, else
0 is returned.
Example
/*This script illustrates the connected command.*/
proc main;
if connected then
display("Connection is on^J^M");
else
display("No connection made^J^M");
endif
endproc
DATABITS databits(integer no_of_bits) : integer;;
Sets the number of data bits for the communication channel. The no_of_bits passed
should be in the range 5 through 8. If the connection is not initialized or no_of_bits is
not in the range 5 through 8, the command is ignored and 0 is returned; otherwise 1 is
returned.
Example
See baudrate command.
DEC dec(var integer integer_variable);;
Decrements integer_variable by 1.
Example
/* This script illustrates arithmetic operators, inc, dec, and mod
commands. */
proc main;
integer x, y;
x = 10;
y = 20;
fdisplay("Value of x is :%d and y is :%d^J^M", x, y);
fdisplay("Sum of x and y is : %d^J^M",x+y);
fdisplay("Differencex-yis:%d^J^M",x-y);
fdisplay("Product of x and y is :%d^J^M",x*y);
fdisplay("Value ofx/yis:%d^J^M",x/y);
fdisplay("Value of x mod y is :%d^J^M", mod(x, y));
fdisplay("Value of x before incrementing is :%d^J^M", x);
inc(x);
fdisplay("Value of x after incrementing is :%d^J^M", x);
fdisplay("Value of x before decrementing is :%d^J^M", x);
dec(x);
fdisplay("Value of x after decrementing is :%d^J^M", x);
endproc
Komentáře k této Příručce