TApxDataPacket.StartString

TApxDataPacket

property StartString : string

The string that causes a packet to start collecting data.

If StartCond is scString, the packet starts collecting data when the string specified by StartString is received.

To specify a control character in the string, use a caret '^' symbol (e.g. ^L^M). To specify a character with ordinal value greater than 127, use the #nnn notation, where "nnn" is an integer in the range 128 to 255. Since '^' and '#' are used in this special way as escape characters, if you want a '^' or '#' as a printable character in the string, it must be enclosed in quotes. To mix printable and non-printable characters in a string, enclose the printable characters in quotes.

The following example sets the StartString to "123 #", followed by a <Ctrl C>, followed by "Sample ^ ^", followed by the unprintable character 255:

ApxDataPacket.StartString := '123 # '^C'Sample ^ ^ '#255;

StartString also supports fixed-length wildcards. The character '?' within a string is interpreted as a wildcard character placeholder which will match any character in the input stream. Wildcards can occur anywhere in the StartString and EndString properties, including at the beginning or end of the strings. For example:

'ATI?'^M^J will match 'ATI0^M^J, 'ATI1'^M^J
'END??'
will match 'END12' and 'END99'
'??BEGIN'
will match 'AABEGIN' and 'BBEGIN'.

Since '?' is now interpreted as a wildcard, an actual '?' in the packet must be escaped by '\' (backslash). To specify an actual '\', use '\\'. For example:

'+FMFR\?' really means '+FMFR?' where the '?' is a literal '?'.
'\\ASC' really means '\ASC' where the '\' is a literal '\'.

See also: EndString, StartCond