2 quick questions.
Hi:
1.
I saw in an OpenGL sample written by Victor that single precision numbers can have an optiona(?) f at the end of the number as in A = 3.5f.
Does this have any significance, or is it just ignored by the compiler?
2.
I would like to initialize an array of user defined type at compile time. I tried some syntax that looked like the syntax for initializing an array and gpf’ed the compiler.
Is this even possible? If not, then what is the most efficient way to initialize a mixed data type array. I understand data statements are all strings and must be converted at runtime.
type entry
a as integer
b AS byte ptr
c as double
end type
dim myentry(0 to 1) as entry =>{ _
{1,”try this”,2.3},
{2,”and this”,3.2}}
???
Thanks
Garvan
What is 3.5f and how to initialize an array of udt
-
- Posts: 1706
- Joined: May 27, 2005 6:34
- Location: Cambodia, Thailand, Lao, Ireland etc.
- Contact:
Yeah, the suffixes f, d, l, ll, ul, ull can be used, the case doesn't matter. The only important ones are the LL and ULL, when working with longint (64-bit) constants.
That type would only work if you did for example: {(strptr("abc", ...) ...}, but i found out that the compiler would crash if strptr was used in var-initializers with literal-strings, the fixes are in CVS..
That type would only work if you did for example: {(strptr("abc", ...) ...}, but i found out that the compiler would crash if strptr was used in var-initializers with literal-strings, the fixes are in CVS..
-
- Posts: 1706
- Joined: May 27, 2005 6:34
- Location: Cambodia, Thailand, Lao, Ireland etc.
- Contact: