Parse

Parse( O,  
 pQ,  
ByRef o1 = "",
ByRef o2 = "",
ByRef o3 = "",
ByRef o4 = "",
ByRef o5 = "",
ByRef o6 = "",
ByRef o7 = "",
ByRef o8 = "",
ByRef o9 = "",
ByRef o10 = "")

Options parser.

OString with options.
pQQuery parameter.  It is a space separated list of option names you want to extract from the options string.  See bellow for details of extraction.
o1..o10Variables to receive requested options.  Their number should match the number of variables you want to extract from the option string plus 1 more if you want to get non-consumed options.

Query

Query is space separated list of variables you want to extract with optional settings prefix . The query syntax is:

Query :: [Settings)][Name=]Value {Query}
Settings :: sC|aC|qC|eC|c01{Settings}
Value   :: SentenceWithoutSpace | 'Sentence With Space'

Examples

options =  x20 y40 w0 h0 red HWNDvar gLabel
options =  w800 h600 style='Resize ToolWindow' font='s12 bold, Courier New' 'show' dummy=dummy=5

Extracting

To extract variables from the option string you first use query parameter to specify how to do extraction then you supply variables to hold the results:

Parse(O, "x# y# h# red? HWND* style font 1 3", x, y, h, bRed, HWND, style, font, p1, p3)
nameGet the option by the name (style, font).  In option string, option must be followed by assignment char (= by default).
NGet option by its position in the options string, (1 3).
str*Get option that has str prefix (HWND*).
str#Get option that holds the number and have str prefix (x# y# h#).
str?Boolean option, output is true if str exists in the option string or false otherwise (red?).

Settings

You can change separator(s), assignment(a), escape(e) and quote(q) character and case sensitivity (c) using syntax similar to RegExMatch.  Option value follows the option name without any separator character.

Parse("x25|y27|Style:FLAT TOOLTIP", "s|a:c1)x# y# style", x, y, style)

In above example, | is used as separator, : is used as assignment char and case sensitivity is turned on (style wont be found as it starts with S in options string).

sCSet separator char to C (default is space).  Parameters are separated by this char except if it is found inside quotes (specified by quote char qC).
aCSet assignment char to C (default is =).  Assigment char is used to name parameter.  Everything after aC will be set as parameter value, everything before as parameter name.
qCSet quote char to C (default is ‘).  Quote char is used to delimit parameter values that contain separator char.
eCSet escape char to C (default is `).  Escape char can be used to specify characters sC, aC, qC and eC inside parameter string.
cNSet case sensitivity to number N (default is 0 = off, 1 = on).

Remarks

Currently you can extract maximum 10 options at a time, but this restriction can be removed for up to 29 options.  You can specify one more reference variable in addition to those you want to extract to get all extra options in the option string.

Returns

Number of options in the string.

About

Close