Assign variables to a string: Weight("Bob") = 200 ???
OK, so I'm still getting the hang of VB and haven't learned the ins and outs yet, so there's probably a very simple answer on here if i just knew the language to search for the correct thing, so i apologize if this question is either excessively simple or redundant.
My problem:
I'm programming a college football game, and I want to keep statistics for all of the different teams during a season. The teams are identified by strings...
Now, it would be a lot easier for me to follow the code and keep it condensed if I could assign values to these teams by name. In other words, if my team is Florida State, I would like to have the following values:
passyards("Florida State")
rushyards("Florida State")
qbrating("Florida State")
But I can't figure out how to assign these variables (passyards, rushyards, qbrating) to a string ("Florida State"). It would be easy enough if this was a regular array with a numberical value in parenthesis like passyards(1), passyards(2), etc., but I'd rather be able to work directly with team names to make the code easier for me to follow.
I know you used to be able to do this back in the day with quickbasic, but I can't figure out how to do it now. Any help is greatly appreciated!
Re: Assign variables to a string: Weight("Bob") = 200 ???
search on how to use "user defined types"