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 / Como eu crio um tipo com arrays?

Author
Message
print TheGourglex
13
Years of Service
User Offline
Joined: 24th Dec 2012
Location:
Posted: 31st Dec 2012 10:26

I would like to create a type in which one of the statements were an array, to replace npc(1).fala1 to npc(1).fala(1).

"Better than do is try"
Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 31st Dec 2012 17:41
Unfortunately that isn't possible.
You could look into array pointers or custom dynamic memory allocations if you really need it, the usual solution is to have a second array to which one of the fields in your type is an index. You must take care to update all instances where this ID occurs should you change the secondary array (ie. remove items or insert anywhere but at the end).


"Why do programmers get Halloween and Christmas mixed up?"

Login to post a reply

Server time is: 2026-07-07 09:04:48
Your offset time is: 2026-07-07 09:04:48