GETUDP Method (Common)
Description
Retrieves a user-defined string of binary data that has been stored with the SETUDP method 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
PropValue = Exec_Method( CtrlEntID, "GETUDP", PropName )
Parameters
Name | Required | Description |
---|---|---|
PropName | Yes | Name of the user-defined property to retrieve. This must begin with an "@" symbol. |
Returns
The stored property data.
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
See Also
'@' (User-defined) property, UDPLIST property, SETUDP method.