Unit 'amigados' Package
[Overview][Constants][Types][Procedures and functions][Index] [#aros]

UnGetC

Makes a char available for reading again. (buffered)

Declaration

Source position: amigados.pas line 2252

function UnGetC(

  File_: Pointer;

  Character: LongInt

):LongInt;

Arguments

File_

  

Filehandle to use for buffered I/O

Character

  

Character to push back or -1

Function result

Character pushed back, or False if the character cannot be pushed back.

Description

Pushes the character specified back into the input buffer. Every time you use a buffered read routine, you can always push back 1 character. You may be able to push back more, though it is not recommended, since there is no guarantee on how many can be pushed back at a given moment.

Passing -1 for the character will cause the last character read to be pushed back. If the last character read was an EOF, the next character read will be an EOF.

Note: UnGetC can be used to make sure that a filehandle is set up as a read filehandle. This is only of importance if you are writing a shell, and must manipulate the filehandle's buffer.


Documentation generated on: 2021-07-30