guides:programming:programmers_reference_manual:build_struct

Build_Struct function

Assembles a binary structure out of BASIC+ variables.

struct = Build_Struct(structname, element1 [, … element32])

Use this function to build a structure to pass to a DLL function. Alternatively, the Var_To_Struct function can be used to convert a dynamic array into a structure 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 Parse_Struct subroutine.

The structure definition must be pre-defined using the Define_Struct routine.

/* 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, Build_Struct
size   = Get_Property(@window, "SIZE")
left   = size<1>
top    = size<2>
right  = size<1> + size<3>
bottom = size<2> + size<4>
rect   = Build_Struct("RECT", left, top, right, bottom)
 
**
**
  • guides/programming/programmers_reference_manual/build_struct.txt
  • Last modified: 2024/06/19 20:20
  • by 127.0.0.1