Please enable JavaScript to view this site.

thinBasic Help Manual

* * HELP & MANUAL PREMIUM PACK 4 DEMO VERSION * *

This documentation was styled with a demo skin from the Premium Pack 4 add-on for Help & Manual. The contents of the skin are encrypted and not configurable. You can only publish HM projects with this skin. You cannot edit it or change it.

This version is copyright and may only be used for local testing purposes. It may not be distributed.

Please purchase the full version of the Premium Pack to get the configurable skins and remove this notice. The package will also include the Toolbox configuration utility for Premium Pack skins.

 

Description

 

Define a User-Defined Data Type (UDT), containing one or more member elements.

UNION differs from TYPE because elements inside an UNION always share the same memory block.

 

Syntax

 

UNION MyUnion

[MemberName AS TypeName]

[MemberArrayName[(nElements)] AS TypeName]

[...]

END UNION

 

Returns

 

None

 

Parameters

 

Remarks

 

Restrictions

 

In case of string element, it is mandatory to specify a fixed size string.

UNIONs cannot have dynamic strings as element type.

 

See also

 

Examples

 

UNION tUnion

  b(12)   As Byte

  st      As ASCIIZ * 12

End UNION

 

Dim MyU As tUnion

MyU.b( 1) = 84

MyU.b( 2) = 104

MyU.b( 3) = 105

MyU.b( 4) = 110

MyU.b( 5) = 66

MyU.b( 6) = 97

MyU.b( 7) = 115

MyU.b( 8) = 105

MyU.b( 9) = 99

MyU.b(10) = 32

MyU.b(11) = 33

 

MSGBOX 0, MyU.st

 

Created with Help+Manual 8 and styled with Premium Pack Version 4 © by EC Software