SETUDP Method (Common)
Description
Stores a user-defined string of binary data using a custom property name. The property name is defined by the developer and must be prefixed with an '@' symbol. This string can be used for any purpose, and stays with the specified object until replaced by another string or the object is destroyed.
Syntax
Call Exec_Method( CtrlEntID, "SETUDP", PropName, PropValue )
Parameters
Name | Required | Description |
---|---|---|
PropName | Yes | Name of the user-defined property to set. This must begin with an "@" symbol. |
PropValue | No | Value of the user defined property to set. This can be null (effectively removing the property). |
Returns
N/A
Remarks
The normal property API (i.e. the Get_Property and Set_Property functions) do not allow binary data to be stored, because any data will be truncated at the first char(0) character encountered (normal property values are usually processed as null-terminated strings). In this case the GETUDP and SETUDP methods can be used to store binary values instead, as they treat the passed value as a length-encoded block.
Note that a user-defined property value set with Set_Property can only be retrieved with Get_Property, and likewise the GETUDP method can only be used to retrieve a property set with the SETUDP method. The two interfaces are not interchangeable.
Example
// Store some binary data in a UDP and retrieve it OSRead BinData From "c:\temp\mydata.dat" Else // Handle error End // Store the data Call Exec_Method( @Window, "SETUDP", "@_MYDATA", BinData ) // ... processing etc ... // Get the data BinData = Exec_Method( @Window, "GETUDP", "@_MYDATA" )
See Also
'@' (User-defined) property, UDPLIST property, GETUDP method.