Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Best way to store large database of things

Status
Not open for further replies.

MrMoocow

Programmer
May 19, 2001
380
US
Okay I'm making a game, in which there are fifty cards, such as

1 - Blah - 100
2 - Moo - 300

Of course they countain meaningful messages.

Now I can't put them in an ACTUAL database, because I can't expect my end user to have it. Whats the best way I don't want to do this

Card(1) = "Blah"
CardValue(i) = 100
...

There must be a Better way.


Regards Brad,
Free mp3 player,games and more.
 
Why can't you expect your end user to have the database? Surely any database you use can be included in your setup package?

ezliko
 
Why not just use a flat text file and do a read loop to load up your arrays as part of the program initialize? Keeps the install package size down if you don't really need to include a data base.
 
Well I found a way to quiclky (as in how I type them) define varables. And as to why I don't want to burden my end user.... Well most "gamers" don't understand why I'm addind this stuff and won't install. Brad,
Free mp3 player,games and more.
 
Surely they will HAVE to install something? And when they install that you can give them EVERY file they need!

It sounds like you think you have to install a database seperatly. Not true.

elziko
 
add the following in the general section of a module:
Type mycard
text As String
number As Integer
End Type

I put this in the form load event to show you how to make and access the user def variable card
Private Sub Form_Load()
Dim myCardArr(1) As mycard
myCardArr(0).text = "something"
myCardArr(0).number = 3
MsgBox myCardArr(0).number
End Sub


I think dwunz has got the right idea on how to store the vars the textfile would look like so:
1, "something",3
2, "secondcard",5
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top