#113 Allow expressions inside variable parse templates.

v3.2.0
closed
David Ashley
5
2012-08-14
2007-02-21
Rick McGuire
No

There are several forms of triggers on the Parse instruction that allow variable usage by wrapping parens around a single variable name:

parse var x a (match) b

for example. The parens are limited to a single variable name, which is a somewhat artificial restriction. Removing this restriction can allow some fairly powerful things to be done with parse. For example,

parse var x "<" tag ">" value ("<\"tag">")

can perform a simple XML tag matchup in a single parse instruction.

Discussion

  • Rick McGuire
    Rick McGuire
    2007-04-02

    Logged In: YES
    user_id=1125291
    Originator: YES

    David, this requires a doc change. In the docs for parse, the following trigger types are no longer restricted to just a variable value, they can be any arbitrary expression: (expr) =(expr) +(expr) -(expr). The restrictions on what the values resolve to are the same.

     


Anonymous


Cancel   Add attachments