Visual Basic / Games / High Scores
Snippet details
ID: 340
Viewed: 1382
Added: 2002-08-19
Version:
here is how you can store and retrieve info (in this case scores) from an ini file. Just create a new standard code module and put this code into it:
Now in your sub main or form load call ReadScores and in your form unload call SaveScores. The resulting ini file will look like:
[HighScore]
Score.0=150
Score.1=149
Score.2=148
Score.3=147
Score.4=146
Score.5=145
Score.6=144
Score.7=143
Score.8=142
Score.9=141
Have fun
Now in your sub main or form load call ReadScores and in your form unload call SaveScores. The resulting ini file will look like:
[HighScore]
Score.0=150
Score.1=149
Score.2=148
Score.3=147
Score.4=146
Score.5=145
Score.6=144
Score.7=143
Score.8=142
Score.9=141
Have fun
General Details
Snippet uploaded by: snippet
Email : webmaster@snippetlibrary.com
Snippet By: Unknown
| Snippet By: | Unknown |
| Declarations | |
| Code | |
| Highlight All | |
No Reviews to show
