Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Dim array to UDT?

Author
Message
Bulsatar
13
Years of Service
User Offline
Joined: 19th Apr 2011
Location:
Posted: 21st Jun 2011 06:43 Edited at: 21st Jun 2011 06:45
Hello Everyone,

I tried, but it doesn't seem to like it...is it possible to dim an array to a user defined type?

example:
Type Rect
rLeft as integer
rRight as integer
rTop as integer
rBottom as integer
endtype

Dim MyArray(10) as Rect

As an aside, if it is possible then would I address the type members like this:

MyArray(i).rLeft = 1
MyArray(i).rRight = 2
etc...
Hodgey
15
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 21st Jun 2011 07:12
Hi, what error message do you get? it looks fine from this angle. This is perfectly fine:


Just adding to your code, this compiles for me


Not sure why it doesn't work for you, do you have the latest build, 7.6? It's either that or you have overlooked something but from what I can see, you have done everything correctly.

A clever person solves a problem, a wise person avoids it - Albert Einstein
Burning Feet Man
16
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 21st Jun 2011 07:53
Looks good to me too. Can you post some more info?

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia
Bulsatar
13
Years of Service
User Offline
Joined: 19th Apr 2011
Location:
Posted: 21st Jun 2011 15:39
doh, the error was coming from another area. Thanks for the confirmation tho

Login to post a reply

Server time is: 2024-11-27 21:49:39
Your offset time is: 2024-11-27 21:49:39