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.

Author
Message
Divided
FPSC Reloaded TGC Backer
10
Years of Service
User Offline
Joined: 31st Oct 2013
Location:
Posted: 19th Nov 2016 01:26
Is it possible to have a type with arrays within it?

eg...


also, are there dynamic arrays in DBP that don't require declaring dimensions first? like a list for example.

Real programmers don't comment their code, because if it was hard to write it must be hard to read!

- PixHil Entertainment
Download Pixel Smasher on the App Store today!
Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 19th Nov 2016 17:46
Arrays in types no, unfortunately.

Dynamic arrays yes

Dim myarray ()
array insert at bottom myarray ()
myarray () = "my value for the new index"
array insert at top myarray ()


A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
damothegreat
User Banned
Posted: 19th Nov 2016 19:25
Is this what you mean and after?



Damo
Using Tier 1 AppGameKit V2
Started coding with AMOS
Anything is possible if put mind to it
damothegreat
User Banned
Posted: 19th Nov 2016 19:26
Ignore me

Just checked and this is DarkBasic section - I'm an AppGameKit chap

sorry
Damo
Using Tier 1 AppGameKit V2
Started coding with AMOS
Anything is possible if put mind to it
revenant chaos
Valued Member
17
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Robbinsdale, MN
Posted: 20th Nov 2016 05:05
As Ortu said arrays within types is not natively supported, but you can use MatrixUtils array pointer commands work around that limitation. Sorry I don't have time at the moment to write an example, but here is something I posted a while back which should get you going.



Here is a link to the original thread.

Login to post a reply

Server time is: 2024-04-18 02:23:24
Your offset time is: 2024-04-18 02:23:24