Please enable JavaScript to view this site.

ESL Documentation

Read a line of characters from the input buffer.

 

char *GetLine ( char *string, int n   )

string

Pointer to a null-terminated char string.

n

An integer value representing the number of characters in string.

Include

LOCALAPP.H

Returns

A string.

Description

This function reads a string from the input buffer and stores it in string. Characters are read up to and including the first newline character ('\n') or until the number of characters read is equal to n-1, whichever comes first.  The result is stored in string and a null character ('\0') is appended.  The newline, if read, is included in string.  If n is equal to 1, string is empty ("").  If the input buffer does not contain a newline and contains less than n-1 characters, the local application becomes suspended and remains so until ESL sends more data that satisfies the read request.