
RASExpress User Guide
176 CommPlete Communications Server
RGETC rgetc(var string buffer [, integer timeout]) : integer;
Gets a character from the remote machine. Timeout is optional and should be in sec-
onds. If the connection is not initialized, the command is ignored and 0 is returned. If
the connection is initialized, the command waits for a character from the remote. If a
character is received, it is copied into buffer (which is terminated with a null) and 1 is
returned; otherwise 0 is returned. If timeout is specified and no characters are re-
ceived within that period, 0 is returned. If timeout is not specified it waits until a
character is received, or until the connection is dropped.
Example
/* This script illustrates the rgetc command. */
proc main;
string s;
integer timeout;
timeout = 5;
fdisplay("Waiting for a character, timeout is : %d
➥ seconds...", timeout);
if rgetc(s, timeout) then
fdisplay("Character received is : %s^J^M", s);
else
display("No character received^J^M");
endif
endproc
RMDIR rmdir(string path_name) : integer;
Removes the directory from the path specified by path_name. If the directory deletion
is successful, 1 is returned, else 0 is returned.
Example
/* This script illustrates the rmdir command. */
proc main;
string name;
integer len;
len = 45;
display("Example for rmdir command^J^M");
display("Enter directory name to remove : ");
if getstr(name, len) then
if rmdir(name) then
fdisplay("^J^M%s removed^J^M", name);
else
fdisplay("^J^M%s could not be removed^J^M", name);
endif
endif
endproc
Comentários a estes Manuais