Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Struct_Len function ====== ==== Description ==== Returns the length in bytes of a structure based on the structure's definition. ==== Syntax ==== //length// = **Struct_Len**(//structname//) ==== Parameters ==== Often API functions require a pointer to structure and the length of the structure as parameters. Some API functions take structures as parameters that contain the size of the structure. In either case, the size of the structure can be determined using the Struct_Len function. The structure definition must be predefined using the Define_Struct routine. ==== See Also ==== [[blank_struct|Blank_Struct()]], [[build_struct|Build_Struct()]], [[define_struct|Define_Struct]], [[var_to_struct|Var_To_Struct()]], [[chapter_dll|Chapter 7 - Calling DLL functions from Basic+]] ==== Example ==== <code> declare subroutine Set_Property, PrintDlg declare function Struct_Len, Build_Struct $insert Logical /* the Windows API function PrintDlg() takes one parameter, a PRINTDLG structure, and uses the information within it to display the standard print dialog. the first element in the PRINTDLG structure is the size of the structure, allowing the PrintDlg() function to be modified over the past decade without breaking code that passes it earlier versions of the PRINTDLG */ lStructSize = Struct_Len("PRINTDLG") printstruct = Build_Struct(lStructSize, ...) /* since the printer dialog is being constructed in a DLL call, block events from OpenInsight while the dialog is displayed */ Set_Property("SYSTEM", "MODAL", TRUE$) PrintDlg(printstruct) Set_Property("SYSTEM", "MODAL", FALSE$) </code> guides/programming/programmers_reference_manual/struct_len.txt Last modified: 2024/06/19 20:20by 127.0.0.1