Home  Contents

mtd16:append

Mtd16 Core4 Lua Commands

SYNOPSIS

mtd16:append(tag, data)

DESCRIPTION

Append a new data field at the end of the message. If tag is not a number, it is looked up in the table mtd16.lutTag to get its numerical value.

The value of data must be appropriate for the type of tag. Alternatively, if data is nil, the command is ignored, appending nothing. This avoids needing to if-check each optional data item.

For IP Addresses, specify the value in dotted quad notation.

ERRORS

Raises an error if tag could not be converted to a number by looking it up in mtd16.lutTag. Also raises an error if the contents of data cannot be encoded into the data type indicated by tag.

EXAMPLE

>  >  > 
msg = mtd16.new(0xF00F) msg:append(0x3001, "FNORD!") print(msg:trace())
0xF00F=(0x3001="FNORD!")

SEE ALSO