DM_GET_TAGVAL

Syntax

string_val = DM_GET_TAGVAL( rec, name[, index] );
Input arguments
handle rec A handle to the tag record to search from.
string name The name of the tag.
Optional input arguments
int index An index to the nth tag with the same name (base 0).

Return Values

Success:
string   Value of the requested tag, or an empty string if tag not found.
Failure:
In case of an error returns a value that is not a string. Use ISSTRING() to test for errors.

Description

This function searches for a tag from the given tag record.

Example

Copy
tr_h = DM_INIT_TAGREC();
DM_SET_TAGVAL(tr_h, "foo", "ABC");
DM_SET_TAGVAL(tr_h, "goo", "DEF", 0);
DM_SET_TAGVAL(tr_h, "goo", "GHI", 1);
s = DM_DUMP_TAGRECS_TO_STRING(tr_h);    /* s: "foo ABC;goo DEF;goo GHI;;" */
foo = DM_GET_TAGVAL(tr_h, "foo");       /* foo: "ABC" */
goo = DM_GET_TAGVAL(tr_h, "goo");       /* goo: "DEF" */
goo_0 = DM_GET_TAGVAL(tr_h, "goo", 0);  /* goo_0: "DEF" */
goo_1 = DM_GET_TAGVAL(tr_h, "goo", 1);  /* goo_1: "GHI" */
doo = DM_GET_TAGVAL(tr_h, "doo");       /* doo: "" */