Unit 'AmigaDOS' Package
[Overview][Constants][Types][Procedures and functions][Variables][Index] [#morphunits]

ReadItem

Reads a single argument/name from command line

Declaration

Source position: amigados.pas line 2176

function ReadItem(

  name: PChar;

  maxchars: LongInt;

  cSource: PCSource

):LongInt;

Arguments

maxchars

  

Size of the buffer. Must be at least 1 (for the #0 terminator).

cSource

  

A ready to use TCSource structure or nil which means 'read from the input stream'.

Function result

ITEM_UNQUOTED
Normal word read.
ITEM_QUOTED
Quoted string read.
ITEM_NOTHING
End of line found. Nothing read.
ITEM_EQUAL
'=' read. Buffer is empty.
ITEM_ERROR
An error happened. IoErr() gives additional information in that case.

Description

Read an item from a given character source. Items are words or quoted strings separated by whitespace or '=' just like on the commandline. The separator is unread and the output string is terminated by a #0 character.

See also

ReadArgs

  

Read bytes of data from a file

FindArg

  

Find a keyword in a template

UnGetC

  

Makes a char available for reading again. (buffered)

FGetC

  

Read a character from the specified input (buffered)

DosInput

  

Identify the program's initial input file handle

FreeArgs

  

Free allocated memory after ReadArgs()


Documentation generated on: 2021-07-30