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 / Arrays within Types

Author
Message
Owl
20
Years of Service
User Offline
Joined: 28th Sep 2003
Location: Imatra, Finland
Posted: 2nd Oct 2003 01:00
Okay, so I want to make my own type. I can

Dim something(many) as mytype

The question is how can you, if at all, declare arrays inside of types? So that I have monkey.banana_length(10), for example. I'd hate to declare that array as a global array instead of an array inside a type, or to start using monkey.banana_length1, monkey.banana_length2, and so on...

I've tried this:


And this:


So, how could you declare arrays inside of type definitions? Or is this simply something that DarkBasicPro doesn't support?
Easily Confused
21
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: U.K. Earth. (turn right at Venus)
Posted: 2nd Oct 2003 02:37 Edited at: 2nd Oct 2003 02:41
Unfortunatly it can't be done.

That doesn't mean it won't be included in a future patch however, I hope so

Programming anything is an art, and you can't rush art.
Unless your name is Bob Ross, then you can do it in thirty minutes.
Owl
20
Years of Service
User Offline
Joined: 28th Sep 2003
Location: Imatra, Finland
Posted: 2nd Oct 2003 02:40
I hope so too, I've only used dbpro for a week, and I've been needing that kind of behaviour for at least 10 times. (or then I'm just exaggerating )
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 2nd Oct 2003 02:49
Hmm, I'm not entirely sure if even C++ can have arrays within a type/struct.
skovron
21
Years of Service
User Offline
Joined: 14th Sep 2003
Location:
Posted: 2nd Oct 2003 10:20
C/C++ can have arays within a struct/class

for example:


or using pointer and dynamic arrays:



and it's very very useful

Login to post a reply

Server time is: 2024-09-21 04:15:14
Your offset time is: 2024-09-21 04:15:14