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
Thu Nov 01 2007, 07:07pm

Registered Member #671
Joined: Tue Sep 25 2007, 12:22pm
Posts: 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
Thu Nov 01 2007, 07:32pm
Registered Member #458
Joined: Thu May 24 2007, 02:20am
Posts: 22
Thats a good contribution Mike! Thankyou! Once I have something I will chuck it up there.

Regards,

Slither2006.
Back to top
Donone
Fri Nov 02 2007, 02:12am
Registered Member #231
Joined: Fri Jan 12 2007, 10:17am
Posts: 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
Fri Nov 02 2007, 03:15am

Registered Member #671
Joined: Tue Sep 25 2007, 12:22pm
Posts: 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
Fri Nov 02 2007, 04:53am
Registered Member #231
Joined: Fri Jan 12 2007, 10:17am
Posts: 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
Fri Nov 02 2007, 07:02am


Registered Member #1
Joined: Wed Apr 19 2006, 08:25pm
Posts: 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
Fri Nov 02 2007, 07:04am

Registered Member #671
Joined: Tue Sep 25 2007, 12:22pm
Posts: 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
 

Jump:     Back to top

Syndicate this thread: rss 0.92 Syndicate this thread: rss 2.0 Syndicate this thread: RDF
Powered by e107 Forum System