On this Page

    _parser.parms

    (As of 3.1.001.03)

    Convert name=value records

    Syntax

    _parser.parms(record

    Parameters

    record is the text to be parsed. Trailing newline and carriage returns are ignored (not returned as data).

    Returned Value

    The returned value of this function is a JavaScript object whose properties are the names parsed from the record and values are their associated values. If the record is incorrectly formatted no messages are issued and a best efforts basis is made to parse the record.

    Description

    This routine is used to parse a name1=value1 name2=value2 ... style record and build up a JavaScript object.

    Example

    var record = 'foo=bar fullName="Jane Doe" party:'O''Brian' IExist"
    var obj = _parser.parms(record);

    Of course, normally one would have read in a record rather than having it hard-coded. This is equivalent to having set:

    obj.foo  = "bar";
    obj.fullName = "Jane Doe";
    obj.party  = "O'Brian";
    obj.IExist = null;

    Either single quotes or double quotes can be used. But the end quote must match the starting quote character in any given value. If the starting quote character needs to appear in the value then it must be doubled up. See 'O''Brian' in the example. Name/Value pairs can be separated by space, tab, comma, or semicolon. Assignment operators can be either equals (=) or colon (:). If a name is not followed by an assignment operator it will be given a value of null.  If an assignment operator and a value are not preceded by a name, they will be discarded.

    See Also

    _parser.delimited
    _parser.delimitedToXml
    _parser.fixed
    _parser.fixedToXml