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 / creating lables ?

Author
Message
simonuk74
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location:
Posted: 23rd Mar 2003 01:23
I`m playing with an idea I have, but I`m not sure if its possible.


can DBP let you use a string for an array name or lable name or function name ?

like this :

andrew11
23
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 23rd Mar 2003 01:30
No. None of them work. It tells you that array name$, label name$, etc does not exist.

"All programmers are playwrights and all computers are lousy actors."

-Anon.

[href]www.geocities.com/andrew11m[/href]
simonuk74
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location:
Posted: 23rd Mar 2003 01:47
hmm,

I know they dont work, but I was wondering, is there a way of doing something similar?

ok, heres another suggestion that would help me get round my problem :
I only just got DBP 2 days ago, so I`m new to the new functions of an array, but I see that they can be altered ( in size ) to suit their need, but can you add a dimension, ie:
can I change
DIM test$(5,5)
to
DIM test$(3,5,2)
?

MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 23rd Mar 2003 01:52
You can if you UNDIM the array before re-defining it, like so :



Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
simonuk74
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location:
Posted: 23rd Mar 2003 01:58
yes, but wouldnt I lose all the information within the array, ( and in the arrays I`m planning on using, they could be huge! )

am I right in saying I would have to copy the array to another (temporary) array, then copy it back, after recreating the new one ?

MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 23rd Mar 2003 02:03
Thats right - you would need to save the data from the array first and put it into a new one...

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
simonuk74
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location:
Posted: 23rd Mar 2003 02:08
what its for is my database

in the one I did in DB, the catagories were fixed, ie : games, GFX apps, audio apps, net apps, so on,

and within those, I`d have the sub catagories
GAMES :
data "action agmes","simualtion games","fps games","racing games"
GFX APPS:
data .....

so on, ( I hope you can see what I was doing there )

Now I have DBP, I`m re-writing the database from scratch, and one of the key things I want to put in it is, the abilty to, when you feel like it, to add/edit/remove a catagory/sub catagory/sub_sub catagory.

one way i thought of doing it was to have a main array, that is user created, for the catagory list
then create a new dim for each catagory to store the sub cats in, but to that, ideally, I would need to name the arrays the same as the catagory ( which would be stored as a CAT$(1) array )

sorry if I got too confusing there...
but I`m confused myself.. lol

MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 23rd Mar 2003 14:36
You would need a linklist system for sub-categories, which would be fun...

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!

Login to post a reply

Server time is: 2026-07-11 08:46:25
Your offset time is: 2026-07-11 08:46:25