Multitech MT5634HD16 Uživatelská příručka Strana 178

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 292
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 177
RASExpress User Guide
168 CommPlete Communications Server
FGETC fgetc(integer file_handle, var string buffer) : integer;
Reads a character from the file given by file_handle into buffer. The buffer is null ter-
minated. If an invalid file handle is passed, the command is ignored and 0 is re-
turned; otherwise the number of bytes read is returned. If an error is encountered
while reading, a negative value is returned.
Example
See fcreate command.
FGETS fgets(integer file_handle, var string buffer, integer max_len) : integer;
Reads a new line terminated string from the file given by file_handle into buffer. Buffer
is null terminated. The maximum number of characters to read can be specified by
max_len, but is limited to 132. Returns the number of bytes read (excluding the null).
If an invalid file handle is passed, the command is ignored and 0 is returned.. If the
end of file is reached, the predefined variable EOF is set. If there is any error in
reading, a negative value is returned.
Example
See fcreate command.
FINDFIRST findfirst(string file_pattern, integer attribute, var string file_name) : integer;
The file_pattern is the pattern to seek in the directory. It can include the drive letter
and path. Attribute is the file attribute to seek. If a file/directory matching the given
pattern is found, file_name is updated; else file_name is not updated. The return value
is 1 if a matching file is found, else it is 0.
Example
/* This script illustrates the findfirst and findnext commands. */
proc main;
string dir_name;
string file_name;
integer len;
integer attribute;
len = 64;
attribute = 0;
display("Example for findfirst and findnext commands^J^M");
display("Enter file pattern : ");
if getstr(dir_name, len) then
fdisplay(" ^J^MFiles in %s are :^J^M", dir_name);
if findfirst(dir_name, attribute, file_name) then
fdisplay("%s^J^M", file_name);
while findnext(file_name) do
fdisplay("%s^J^M", file_name);
endwhile
endif
endif
endproc
Zobrazit stránku 177
1 2 ... 173 174 175 176 177 178 179 180 181 182 183 ... 291 292

Komentáře k této Příručce

Žádné komentáře