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 / Need help with Types, Array inserting, and array deleting

Author
Message
The Lone Programmer
23
Years of Service
User Offline
Joined: 29th Jan 2003
Location: California, USA
Posted: 5th Nov 2003 04:21
Ok,
I have been brainstorming... Since most people by now know that I absolutely hate functions and you probably know I will never use them.

For my Item menu I have still been thinking.. This is what I came accross and I need help.

Type:
I am for some reason unable to save any kind of type array. It will not let me.
I am unable to use: array insert at top
I am unable to use: array insert at bottom
I am unable to use: array instert element
I am unable to use: empty array

Why cant I use these with a type array...

Array insert at bottom
This command does not work period with any kind of array...

Empty Array:
When used with normal array it glitches out an prints numbers everywehre.

array delete Element
This command does not do what it says... it says it just delets one and moves everything up one... instead it removes all added array elements.


Anyway for my brainstorming here is what I came up with.

I use the for/next command. As you guys know when you do this:
for x=1 to 10
print item(x)
next x

it will print all 10 items in array order...
I figure if i cant destroy an array then it will replace it with the following arrays.

if i remove #3 then it just skips #3 and prints 4-10

Well Help on everything would be nice....

Thanks
Nicolas

*Current Project: Untitled RPG
*Working With: Vash the Stampede 815
*http://www.blazing-fire.tk
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 5th Nov 2003 08:38
All of those commands work great (possible exception ARRAY INSERT AT TOP), it's your understanding of them that is causing your problems ... unless you *still* haven't installed Update 5.1

I have both queues and stacks in the CodeBase, I might as well put simple list/array manipulation there too - I'll get an example together tonight rather than put detailed usage here right now
APEXnow
Retired Moderator
23
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 5th Nov 2003 08:41
Quote: "Type:
I am for some reason unable to save any kind of type array. It will not let me.
I am unable to use: array insert at top
I am unable to use: array insert at bottom
I am unable to use: array instert element
I am unable to use: empty array
"


I do not understand why you are having problems with this. Can you elaborate on the problem you're having? But, to further this query, here is a typical example of how I use these functions.

See source button

Now, although you do not need to know what every part of these functions do, the OBJECT_Initialize function just gets called once to create the array ready for use.

The OBJECT_Spawn function, adds elements to the array, and finally, OBJ_Delete removes elements from the array. This is a typical set of functions that I use for loading, managing and deleting dyanmic objects within the game system. The error checking etc is irrelavent for this example.


IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 5th Nov 2003 08:54
As of 11pm last night (UK time) he hadn't installed any updates. I'm hoping he has now, otherwise he's in for a bumpy ride ...
APEXnow
Retired Moderator
23
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 5th Nov 2003 13:23
LOL, good point!


The Lone Programmer
23
Years of Service
User Offline
Joined: 29th Jan 2003
Location: California, USA
Posted: 5th Nov 2003 16:44
I installed the updates but still need help..



Nicolas

*Current Project: Untitled RPG
*Working With: Vash the Stampede 815
*http://www.blazing-fire.tk

Login to post a reply

Server time is: 2026-07-26 16:03:29
Your offset time is: 2026-07-26 16:03:29