====== Parse_Struct subroutine ====== ==== Description ==== Extracts elements from a structure into BASIC+ variables. ==== Syntax ==== **Parse_Struct**(//struct//, //structname//, //element1// [, … //element32//]) ==== Remarks ==== Use this function to parse a structure returned by a DLL function. Alternatively, the [[struct_to_var|Struct_To_Var function]] can be used to convert a structure into a dynamic array as long as none of the elements are char or char array types containing character values greater than @VM (hex FD, decimal 253). This function is the opposite of the [[build_struct|Build_Struct function]]. The structure definition must be predefined using the [[define_struct|Define_Struct]] routine. ==== See Also ==== [[build_struct|Build_Struct()]], [[struct_to_var|Struct_To_Var()]], [[var_to_struct|Var_To_Struct()]] ==== Example ==== /* assumes the structure called RECT has been defined as being composed of 4 "signed short" elements and the API function GetWindowRect has been defined in DLL_USER as: VOID PASCAL GetWindowRect(USHORT, LPCHAR) */ declare function Get_Property, Blank_Struct, GetWindowsRect declare subroutine Parse_Struct hwnd = Get_Property(@window, "HANDLE") rect = Blank_Struct("RECT") GetWindowsRect(hwnd, rect) Parse_Struct(rect, "RECT", left, top, right, bottom)