The online racing simulator
Visual Basic 6 programming help
(4 posts, started )
Visual Basic 6 programming help
Using RayOks okSocket I started experimenting with InSim for the first time and actually managed to do stuff, very easy to use

Problem is I can't remember all that much about Visual Basic since I finished Higher Computing at school 2 years ago, so this may sound like a very basic question and hopefully is

Problem I've got is I want to keep tabs on drivers laps. Now how I was planning on doing it is basically recording every PlayerLap so everytime they crossed the line I'd add a lap to their total. My problem is I don't quite know the best way to do this. I can manage it just fine tracking one user but don't really know what to do with more than that as I need to store it somehow.

I was thinking a database might be the best solution but haven't done database stuff in visual basic before. Would it be feasible to write/read to a .txt file on the fly? Wasn't sure how easy it would be to use the drivers name to find out the amount of laps they'd done ... Doesn't really have to be anything fancy, as long as it works

Thanks & Merry Xmas

Keiran
Quote from keiran :I was thinking a database might be the best solution but haven't done database stuff in visual basic before. Would it be feasible to write/read to a .txt file on the fly? Wasn't sure how easy it would be to use the drivers name to find out the amount of laps they'd done ... Doesn't really have to be anything fancy, as long as it works

Assuming you don't want to have the data persist across program shutdowns, writing it off to a text file would be insanely slow.

I believe Visual Basic has something like structs from C/C++ (records, I think?). Simply define an array of records and update as you need. Then sort the array when you want to find corresponding information.
#3 - Stuff
Writing to a text file wouldn't be that slow. Plenty fast when it comes to laps. It's the method I used when I made a manager program for NAL a while ago. It wrote to a .csv file, which VB6 makes very easy to both read and write. It all depends on what you need to write and how often. For the database method, I've actually never messed with VB6 and a database. Seems to be a lot of work to set all that up when it comes to just using the system for LFS and distributing it to others.

For storing stuff temporarily, like in the array the_angry_angel mentioned, the VB6 method would either be a user-defined-type (the struct) or create a class and stick it into a dynamic array or a collection.

Hmm, since NAL is out of business I was thinking of releasing the source for that manager program I wrote. Especially if Im planning to really learn C++ or develop my skills more in Java.

Also, maybe move this thread to the programming section?
Thanks for the tips guys, had a look into a few things but still need to think it through properly on how I'm going to work it .

From what I can remember of arrays I don't know if my knowledge is going to be sufficient to use them effectively. I can only remember the very basics of basically making a list of items in the one variable. So I can't see how I could tie a list of laps to the list of drivers effectively if you get what I mean :S.

Wasn't sure whether I should have posted it in the programming section as it technically wasn't a LFS programming specific problem, just my lack of knowledge on VB6 (is there a manual like the PHP one?, that PHP manual makes it so much easier) Thanks to your OkSocket the LFS part is taken care of, I think I don't understand much of anything in there but you certainly made it easy to fish out the information

Keiran

Visual Basic 6 programming help
(4 posts, started )
FGED GREDG RDFGDR GSFDG