Description

Converts an @fm-delimited variable into a structure placing, obtaining each structure element from the corresponding field in the variable.

Syntax

struct = Var_To_Struct (var, structname)

See also

Blank_Struct()Build_Struct()Define_StructParse_StructStruct_To_Var()

Remarks

Use Var_To_Struct when you want to convert an @fm-delimited array into a structure. Alternatively, use Build_Struct() when you want to convert a set of variables into a structure or when the structure contains char or char array fields that will contain characters with values greater than @VM (hex FD, decimal 253).

This function is the opposite of the Struct_To_Var function.

The structure definition must be predefined using the Define_Struct routine.

Example

/* Assuming the structure called RECT has been defined as being composed of 4 "signed short" elements,
this code builds a rectangle structure based on the location and size of an OpenInsight form */
 
declare function Get_Property, Var_To_Struct
 
* build the rectangle out of the SIZE property
 
size    = Get_Property(@window, "SIZE")
size<3> = size<3> + size<1> ;* convert width to right
size<4> = size<4> + size<2> ;* convert height to bottom
rect    = Var_To_Struct(size, "RECT")
  • No labels