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.

DarkBASIC Professional Discussion / UDT's - Problem or Program Limitation

Author
Message
Scofflaw
22
Years of Service
User Offline
Joined: 23rd Jan 2003
Location: United States
Posted: 26th Jan 2003 00:54
Quick question for anyone who can help.

In using User Defined Types is it possible to use arrays within the type, within the type. Here is a few examples of what I mean.


topLevel(100).nextLevel(50).thirdLevel(10)

or

topLevel.nextlevel(50).thirdLevel

or

topLevel.nextlevel.thirdLevel(10)

and so on....

It seems that no matter which way I try and set it up using Dim's and what not I just cannot get it to compile.
UDT's work out very well in VB and it would make my code in DBP allot cleaner.

If i'm not clear on what i'm asking please let me know.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 26th Jan 2003 00:58
Arrays are currently unsupported inside of types.
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 26th Jan 2003 00:58
Types don't allows Arrays within them (yet)

i think the problem is more they don't have an open declaration - because if you did
type MyType
person as Array()
endtype

then it'd pointer to the function
and if you did

type MyType
person as Array(255)
endtype

it'd pointer to the Array positioned data (ie whatever type the array has)
i still vote to change arrays to
dim Array[] as in C|C++ style and it would solve confusion, but if the function setup is anything to go by they can't ... however maybe {} would work

Anata aru kowagaru no watashi!
Scofflaw
22
Years of Service
User Offline
Joined: 23rd Jan 2003
Location: United States
Posted: 26th Jan 2003 02:08
Thanks for the info.
Hopefully in a future patch they will be supported.

Login to post a reply

Server time is: 2025-05-19 13:00:40
Your offset time is: 2025-05-19 13:00:40