Seed7 - The extensible programming language
Seed7 FAQ Manual Screenshots Examples Libraries Algorithms Download Links
Libraries AES ARC4 Array ASN.1 Bigfile Bigint Bigrat Bin32 Bin64 Bitdata Bitmapfont Bitset Bitsetof Boolean Browser Bstring Bytedata Cards Category CC config Cgi Cgi dialog Char Charsets Cipher Clib_file Color CLI Commands Complex Console Crc32 Deflate DES Dialog Dir Draw Duration Echo Editline Enable_input Enable_io Enable_output Encoding Environment External_file File File system Float Font Forloop Ftp Getf Gethttp Gethttps Graph Graph_file Gzip Hash Hashsetof Hmac Html_ent Httpserv Idxarray Image Inflate Inflate file Inifile Integer Keybd Line Listener LZW Make Math Msgdigest Null_file Osfiles Picture utility Pixmap_file Pixmapfont PKCS #1 Poll Process Progs Propertyfile Rational Reference Ref_list Scanfile Scanstri Set Shell Smtp Sockbase Socket SQL base Stdio Strifile String Stritext Subrange Tar Text Time TLS/SSL Triple DES Unicode Utf16 Utf8 Vectorfont 3D Vector Window Wrinum X.509 Xmldom Xml_ent Zip
Libraries
Editline Source Code
 previous   up   next 

Types
editLineFile
File implementation type for linewise editing with history.

editLineFile

const type: editLineFile

File implementation type for linewise editing with history. The possibilities of editing are described in the documentation of the function getln.


Function Summary
file
openEditLine (in file: inFile, in file: outFile)
Open an Unicode filter file for linewise editing with history.
file
openEditLineLatin1 (in file: inFile, in file: outFile)
Open a Latin-1 filter file for linewise editing with history.
string
getln (inout editLineFile: inEditLine)
Read a line from inEditLine.
char
getc (inout editLineFile: inEditLine)
Read a character from inEditLine.
string
gets (inout editLineFile: inEditLine, in integer: length)
Read a string with maximum length from inEditLine.
boolean
eof (in editLineFile: inEditLine)
Determine the end-of-file indicator.
boolean
hasNext (in editLineFile: inEditLine)
Determine if at least one character can be read successfully.

Function Detail

openEditLine

const func file: openEditLine (in file: inFile, in file: outFile)

Open an Unicode filter file for linewise editing with history. Unicode characters and editing keys are read from inFile. All Unicode characters are accepted and written to outFile. To avoid RANGE_ERROR use an Unicode capable file as outFile. The following editing keys are accepted: Backspace, delete, home, end and the cursor keys. The history is accessed with the vertical cursor keys. Ctrl-C and ctrl-T allow terminating the program. Other keys (e.g. function keys) are ignored. Call openEditLine with

IN := openEditLine(KEYBOARD, OUT);

to allow editing standard console input.

Returns:
the file opened.

openEditLineLatin1

const func file: openEditLineLatin1 (in file: inFile, in file: outFile)

Open a Latin-1 filter file for linewise editing with history. Unicode characters and editing keys are read from inFile. Only Latin-1 characters are accepted and written to outFile. Unicode characters beyond ISO Latin-1 (ISO-8859-1) are ignored. This allows that a normal byte file is used as outFile. The following editing keys are accepted: Backspace, delete, home, end and the cursor keys. The history is accessed with the vertical cursor keys. Ctrl-C and ctrl-T allow terminating the program. Other keys (e.g. function keys) are ignored. Call openEditLine with

IN := openEditLineLatin1(KEYBOARD, OUT);

to allow editing standard console input.

Returns:
the file opened.

getln

const func string: getln (inout editLineFile: inEditLine)

Read a line from inEditLine. Before the line is sent it can be edited. It is possible to move the cursor with horizontal cursor keys. The home key and the end key move the cursor to the beginning respectively end of the input line. Characters can be inserted at the current cursor position. Backspace and delete can be used to remove characters. Vertical cursor keys allow browsing the history of input lines. Sending the line is done with enter/return ('\n'). The line ending character is not copied into the string. When the function is left inEditLine.bufferChar contains '\n' or EOF.

Returns:
the line read.

getc

const func char: getc (inout editLineFile: inEditLine)

Read a character from inEditLine.

Returns:
the character read, or EOF at the end of the file.

gets

const func string: gets (inout editLineFile: inEditLine, in integer: length)

Read a string with maximum length from inEditLine.

Returns:
the string read.
Raises:
RANGE_ERROR - The length is negative.

eof

const func boolean: eof (in editLineFile: inEditLine)

Determine the end-of-file indicator. The end-of-file indicator is set when at least one request to read from the file failed.

Returns:
TRUE if the end-of-file indicator is set, FALSE otherwise.

hasNext

const func boolean: hasNext (in editLineFile: inEditLine)

Determine if at least one character can be read successfully. This function allows a file to be handled like an iterator.

Returns:
FALSE if getc would return EOF, TRUE otherwise.


 previous   up   next