ArianeSoft - Programming and development for Windows and Windows Mobile :: Forums :: PPL - Pocket Programming Language :: Code sharing |
|
<< Previous thread | Next thread >> |
Another one from me! |
Moderators: kornalius, bmanske, PointOfLight
|
Author | Post | ||
Mike Halliday |
| ||
Registered Member #671 Joined: Tue Sep 25 2007, 12:22pmPosts: 400 | Here is a highscore routine Read from file, write to file and display on screen! Highscores.dat contains 10 scores and names 3 extra funcs/procs readHIGHSCORES() - loads the file in to global array, returning FALSE if the file is not found. sortHIGHSCORES() - bubble sorts high to low and dumps the lowest from the list writeHIGHSCORES() - updates the highscores.dat file If the highscores.dat file is missing you are warned that saves are unavailable and temp score are created. Hope its useful! - See how it works in the example code. [Mike] 1193958437_671_FT0_highscores.zip Editor of \'Voice of the PPL\' the newsletter for the PPL by the PPL! Still trying to get people to contribute to the newsletter! | ||
Back to top | | ||
Slither |
| ||
Registered Member #458 Joined: Thu May 24 2007, 02:20amPosts: 22 | Thats a good contribution Mike! Thankyou! Once I have something I will chuck it up there. Regards, Slither2006. | ||
Back to top | | ||
Donone |
| ||
Registered Member #231 Joined: Fri Jan 12 2007, 10:17amPosts: 626 | Hello Mike. Great and very very useful. Will save a lot of time for everybody needing it. BTW a small problem with the array size line 62, you either need 10 as your max or simply set Dim(Name$,12) & Dim(score$,12) and it's fine (remember zero based). I like the fading into obscurity! [ Edited Fri Nov 02 2007, 02:15am ] You only stop learning when you die. Sometimes I think I am dead http://www.don-simmonds.co.uk | ||
Back to top | | ||
Mike Halliday |
| ||
Registered Member #671 Joined: Tue Sep 25 2007, 12:22pmPosts: 400 | Glad you all like it so far. I tried with 10 as the Array Max and was hitting an Access Violation so I upped it - I think this was because I was not closing down fully and there was some variable leak Could be another vista issue - needs more investigation. Editor of \'Voice of the PPL\' the newsletter for the PPL by the PPL! Still trying to get people to contribute to the newsletter! | ||
Back to top | | ||
Donone |
| ||
Registered Member #231 Joined: Fri Jan 12 2007, 10:17amPosts: 626 | Setting Dims to 12 worked fine for me. Prior to that I got the access violation. Keep it coming You only stop learning when you die. Sometimes I think I am dead http://www.don-simmonds.co.uk | ||
Back to top | | ||
kornalius |
| ||
Registered Member #1 Joined: Wed Apr 19 2006, 08:25pmPosts: 2783 | Thank you very much Mike for the contribution and the time you spend helping others, this is very appreciated. So much new content for the newsletters! Regards, Alain Deschenes President and programmer ArianeSoft Inc. (http://www.arianesoft.ca) | ||
Back to top | | ||
Mike Halliday |
| ||
Registered Member #671 Joined: Tue Sep 25 2007, 12:22pmPosts: 400 | Element 11 of the array stores the current score and I the code looks for A$+1 so when A$ reaches 10 .. 11 should work, but it doesn't unless you include an extra space in the array!!! - most strange. Editor of \'Voice of the PPL\' the newsletter for the PPL by the PPL! Still trying to get people to contribute to the newsletter! | ||
Back to top | | ||