Skip to content

SScanf

Scan a string for substrings and return the substrings

Declaration

Source position: sysstrh.inc line 252

  function SScanf(const s: string; const fmt: string; 
                 const Pointers: Array of Pointer) : Integer;

Description

SSCanF scans the string S for the elements specified in Fmt, and returns the elements in the pointers in Pointers. The Fmt can contain placeholders of the form %X where X can be one of the following characters:

d
Placeholder for a decimal number.
f
Placeholder for a floating point number (an extended)
s
Placeholder for a string of arbitrary length.
c
Placeholder for a single character

The Pointers array contains a list of pointers, each pointer should point to a memory location of a type that corresponds to the type of placeholder in that position:

d
A pointer to an integer.
f
A pointer to an extended.
s
A pointer to an ansistring.
c
A pointer to a single character.

Errors

No error checking is performed on the type of the memory location.

See also

Name Description
Format Format a string with given arguments.