Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
APIs from QB64PE and parameters defined As Any and unions of types ?
#2
A "union{}" is a mixed type in C. It is comparable to a *)"struct{}" in C with the difference that all variables share the same memory space; the memory space is determined by the compiler based on the longest variable.
*)A C-struct{} is comparable to Type ... End Type in Basic.

Code: (Select All)

union beispiel
{
  float preis;
  int anzahl;
} beispiel_fuer_zwei;

The "As Any" command in Visual Basic is used to remove the parameter type check when passing parameters. Simply put, it is a hint to the programmer that there is a type difference.

Code: (Select All)

Declare Function xyz ( . . .ByVal lpString As Any) As Integer
Reply


Messages In This Thread
RE: APIs from QB64PE and parameters defined As Any and unions of types ? - by Kernelpanic - 05-30-2024, 09:02 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  need help playing sound using certain parameters madscijr 0 389 04-01-2025, 03:52 PM
Last Post: madscijr
  Does _MapTriangle work in a user defined Window? bplus 12 2,214 02-16-2024, 01:40 AM
Last Post: bplus
Question Last 2 parameters of Locate bplus 5 1,058 01-20-2024, 08:47 PM
Last Post: TerryRitchie
  Arrays In User Data Types Consolemu 2 864 01-18-2024, 09:49 PM
Last Post: bplus
  Why aren't these subroutines working on user defined types? James D Jarvis 4 1,089 11-12-2023, 05:41 AM
Last Post: eoredson

Forum Jump:


Users browsing this thread: 1 Guest(s)