Qbasicnews.com

Full Version: How do i define a type?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i need to know how to define a type so i can recall its attributes later on
a set of standard variables. As an example, we'll make a user defined type (called MYTYPE) consisting of an INTEGER variable, a SINGLE variable, and an 8-byte string:

TYPE MYTYPE
A AS INTEGER
B AS SINGLE
C AS STRING*8
END TYPE

That defines the type. To use it, you have to DIM a variable as that type, e.g.,

DIM MYVAR AS MYTYPE

To get to the variable A, you would refer to MYVAR.A. And then there's MYVAR.B and MYVAR.C as well.
Our proud QBOHO provides all answers Wink