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 / Type array in array

Author
Message
bfrnhout
15
Years of Service
User Offline
Joined: 28th Oct 2008
Location: Vlissingen
Posted: 22nd Jun 2015 23:21
I don't know if its possible to make a array type in another type.

e.g.

Type Planet_T
Naam as string
Moons[5]

Games is live so to live do the games
bfrnhout
15
Years of Service
User Offline
Joined: 28th Oct 2008
Location: Vlissingen
Posted: 22nd Jun 2015 23:24
Soor for the mess. I did somthing stupid and now my topic is screwed up.

Anyway

e.g.
Type Planet_T
Name As string
Moon [5] `i use then 5 elements pointing to the moon type
Resource[16] `Resource that are in the ground
ServeyTime[16]

Games is live so to live do the games
bfrnhout
15
Years of Service
User Offline
Joined: 28th Oct 2008
Location: Vlissingen
Posted: 22nd Jun 2015 23:29
`The time that is needed for getting the resource up
End type

Sorry for the mess.

the numbers between [] is actualy an array.
I need to make so 100 planets and each of the planet may or maynot haveing a moon. And if so the moon in pointing to the type where the data of the moon is.
The resource is what i can find on the planet en servey time is used to calculate how many hourse i need to get 1 unit above ground.

I hope that this in undertandable.

Games is live so to live do the games
Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 23rd Jun 2015 00:53
unfortunately no, you cannot declare an array within a type. you can use linked lists and array pointers as a work around.

Login to post a reply

Server time is: 2024-04-19 23:32:09
Your offset time is: 2024-04-19 23:32:09