====== Var_To_Struct function ====== ==== 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|Blank_Struct()]], [[build_struct|Build_Struct()]], [[define_struct|Define_Struct]], [[parse_struct|Parse_Struct]], [[struct_to_var|Struct_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|Struct_To_Var function]]. The structure definition must be predefined using the [[define_struct|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")