There IS a better way! First, you can try this tutorial I made about arrays, if you like:
http://forum.thegamecreators.com/?m=forum_view&t=84908&b=7 This way you won't need a bunch of variables.
See if that gives you any ideas. You could make one array to store all of the player's integer values (Health, Mana, etc.) And another for strings, and another for real numbers!
Secondly, you could also use types, which would be better for this since you have several different kinds of values (STRINGS, INTEGERS, REAL NUMBERS...)
DBPRO ONLY!!!!!!!!!
Types are not too hard to learn. They can help a bunch, too. To declare a type, use the
TYPE command. To end it, use
ENDTYPE Simple enough. Now for the good stuff: You can put different categorys into types. Foerexample, say you were making an RPG. (heh heh I bet you are) You may want to store the player's health and his mana in one array. Well, you could try this:
rem Setup the demo
sync on
sync rate 0
rem Let's begin making the type now. We'll call it "stats" because it is the player's stats, after all.
Type Stats
rem make the stat for health, and make it store an integer number.
Health as integer
rem Now, make the stat for mana, and make it too store an integer number.
Mana as integer
rem Now, end the type.
endtype
rem Make an array with one integer: the player! Here, we can declare the array as a type! The type is called STATS, so we declare it as STATS!
dim Player(1) as Stats
rem Make the player's health 100 to demonstrate. The ".Health" is to say that we are talking about the health part of STATS, which this array now is.
Player(1).Health=100
rem Make the mana 200.
Player(1).Mana=200
rem Begin the loop
do
rem Set the cursor to start
Set cursor 0,0
rem Print the Health to the screen first. The "str$" translates any value into a string.
print "HEALTH: ",str$(Player(1).Health)
rem Print the mana too!
print "MANA: ",str$(Player(1).Mana)
rem Update the screen
sync
rem The end of the loop. Say "you can go back to do now".
loop
That would allow you do store mana and health both in one array. Only works in DBPro though, for types are not included in DBC. My array tutorial is fine in DBC though, I think. Try it!