Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This function is the opposite of the Var_To_Struct function.

The structure definition must be predefined using the Define_Struct routine.

...

Define_StructParse_StructVar_To_Struct()

Example

Code Block
/* 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, GetWindowsRect
declare function Blank_Struct, Struct_To_Var
 
hwnd = Get_Property(@window, "HANDLE")
rect = Blank_Struct("RECT")
GetWindowsRect(hwnd, rect)
Size = Struct_To_Var(rect, "RECT")
 
* build the SIZE property out of the returned rectangle
 
Size<3> = Size<3> - Size<1>  ;* convert right to width
Size<4> = Size<4> - Size<2>  ;* convert bottom to height