Page 1 of 1

Combining an array and type

Posted: Wed Jun 08, 2005 2:48 pm
by Seb McClouth
I was wondering sumfin. If it would be possible to do the following:

Code: Select all

TYPE PARAM
     POS as integer
     MODE as integer
     LINES as integer
END TYPE

DIM SHARED PARAME(50) as PARAM

PARAME(1).POS = 1
PARAME(2).POS = 4
I don't have QB at hand so... if you plz...

grtz
Seb

Posted: Wed Jun 08, 2005 3:02 pm
by Z!re
Yes.

Also, array index start at 0, learn to use it.

Posted: Thu Jun 09, 2005 2:42 am
by Seb McClouth
Alrighties... I know it starts at 0 but it's so much easier to use 1 to 50 then 0 to 49, I just hate (read: dislike) the fact using the line command in whatever screen mode you have to say line (0,0)-(639,479) instead of Line (1,1)-(640,480), if you get what I mean.

But anywayz, thx!!!

Grtz
Seb

Posted: Thu Jun 09, 2005 2:14 pm
by Deleter
well, then you can define it like this and not waste memory:
Dim Shared Parame(1 to 50) as PARAM
that way it starts at one and contains 50 elements

Posted: Fri Jun 10, 2005 4:05 am
by Seb McClouth
Okay good one. Hehehe, and I just changed my weekdays(7) to weekdays(6) in my qbinux-source. But thanks for the hint!!