GETLINE - read a line from an input unit.

Alternate entries: GET.LN

Usage:

B:
   string = getlin( [unit, ] string [, length] );
C:
   int getlin([FILE *unit,] char *string [, int length] );

Description:

GETLINE behaves in exactly the same way as GETSTR except that the trailing '*n' is included in the string that GETLINE obtains.

Notes:

GETLINE stops when it encounters either '*n' or '*0'. The C function "fgets" (which is similar to GETLINE) does not stop on an ASCII NUL ('*0'). Also, the "fgets" and GETLINE interpret the "length" argument slightly differently. GETLINE will stop reading after accepting "length" characters, and will store '*0' at character offset "length". "fgets" will stop after accepting "length-1" characters and store the '*0' at byte offset "length-1". That is "fgets" counts the final '*0', and GETLINE does not.

See Also:

expl b lib getstr

Copyright © 2000, Thinkage Ltd.