DECLARE FUNCTION j2$ (n!) DECLARE FUNCTION pdata$ (tm!, pb$, ps!, pt!) DECLARE FUNCTION j$ (j!) DECLARE FUNCTION ptime$ (tm!) DECLARE SUB ssorttemp () pbpoints = 5 winpoints = 50 wide = 6: REM printout this many last races ff$ = CHR$(12) DIM races$(20), ssort$(20), cnt(20) RESTORE racedata noofraces = 0 DO UNTIL nname$ = "end" noofraces = noofraces + 1 READ nname$, srt$ races$(noofraces) = nname$: ssort$(noofraces) = srt$ LOOP noofraces = noofraces - 1 IF srt$ <> "end" THEN PRINT #1, "Race data error": STOP OPEN "champ00.txt" FOR OUTPUT AS #1 OPEN "woodys.txt" FOR OUTPUT AS #2 RESTORE runnerdata REM check data count = 0: nname$ = "" DO UNTIL nname$ = "end" READ nname$, div IF nname$ <> "end" THEN count = count + 1 FOR r = 1 TO noofraces READ tm, ps, pb$ IF tm <> 0 OR ps <> 0 THEN cnt(r) = cnt(r) + 1 NEXT READ test$ IF test$ <> "end" THEN PRINT "Error in runner data",test$,nname$: STOP END IF LOOP DIM runners$(count), divs(count) DIM timedata(noofraces, count), posdata(noofraces, count), pbdata$(noofraces, count) DIM points(noofraces, count), temp(2, count) RESTORE runnerdata FOR runner = 1 TO count READ runners$(runner), divs(runner) FOR race = 1 TO noofraces READ timedata(race, runner), posdata(race, runner), pbdata$(race, runner) IF pbdata$(race, runner) = "Y" THEN pbdata$(race, runner) = "y" NEXT READ dummy$: IF dummy$ <> "end" THEN STOP NEXT READ a$, b$ IF a$ <> "end" OR b$ <> "0" THEN STOP FOR race = 1 TO noofraces PRINT #2, : PRINT #2, : PRINT #2, TAB(10); races$(race) IF ssort$(race) = "p" OR ssort$(race) = "P" THEN REM sort on pos FOR r = 1 TO count temp(1, r) = r IF posdata(race, r) = 0 THEN temp(2, r) = 999999 ELSE temp(2, r) = posdata(race, r) NEXT ELSE REM sort on time FOR r = 1 TO count temp(1, r) = r IF timedata(race, r) = 0 THEN temp(2, r) = 999999 ELSE temp(2, r) = timedata(race, r) NEXT END IF ssorttemp FOR r = 1 TO count IF temp(2, r) = 999999 THEN p = 0 ELSE PRINT #2, TAB(10); j$(r); " "; runners$(temp(1, r)); TAB(35); ptime$(timedata(race, temp(1, r))); IF pbdata$(race, temp(1, r)) = "y" THEN PRINT #2, " pb" ELSE PRINT #2, n = 0: first = 0 FOR x = 1 TO count IF temp(2, x) = temp(2, r) THEN n = n + 1: IF first = 0 THEN first = x NEXT p = winpoints - first + 1 - .5 * (n - 1) END IF IF p > 0 AND (pbdata$(race, temp(1, r)) = "y") THEN p = p + pbpoints points(race, temp(1, r)) = p IF p > 0 THEN posdata(race, temp(1, r)) = r NEXT NEXT REM add up points to get total FOR r = 1 TO count s = 0 FOR t = 1 TO noofraces s = s + points(t, r) NEXT points(0, r) = s NEXT FOR r = 1 TO count temp(1, r) = r: temp(2, r) = points(0, r) NEXT ssorttemp REM find last few races only FOR r = noofraces TO 1 STEP -1 IF cnt(r) > 0 THEN lastrace = r: EXIT FOR NEXT IF lastrace < wide THEN lastrace = wide CLS PRINT #1, TAB(10 * wide); "Sunderland Strollers Club Championship 2000" PRINT #1, PRINT #1, "Pos Div Name Tot."; SPC(16 - LEN(races$(lastrace - wide + 1)) / 2); FOR t = lastrace - wide + 1 TO lastrace PRINT #1, races$(t); SPC(20 + LEN(races$(t)) / 2 - LEN(races$(t)) - LEN(races$(t + 1)) / 2); NEXT PRINT #1, PRINT #1, TAB(39); "time pos pts "; FOR r = 1 TO wide - 1 PRINT #1, "time pos pts "; NEXT PRINT #1, FOR r = count TO 1 STEP -1 p = temp(1, r) IF points(0, p) <> 0 THEN REM if runner has points then print his details, else leave out of main table PRINT #1, j$(count - r + 1); " "; j$(divs(p)); " "; runners$(p); TAB(27); j2$(points(0, p)); SPC(3); FOR t = lastrace - wide + 1 TO lastrace IF posdata(t, p) = 0 AND timedata(t, p) = 0 THEN PRINT #1, SPC(20); ELSE PRINT #1, SPC(2); pdata$(timedata(t, p), pbdata$(t, p), posdata(t, p), points(t, p)); END IF NEXT PRINT #1, IF (count - r + 1) MOD 5 = 0 THEN PRINT #1, STRING$(33, "."); FOR t = lastrace - wide + 1 TO lastrace PRINT #1, STRING$(20, "."); NEXT PRINT #1, END IF END IF NEXT PRINT #1, PRINT #1, " Division 1 Division 2 Division 3 Division 4 Division 5" PRINT #1, DIM d$(5), pts(5) n = 0 flag = 1 DO UNTIL flag = 0 flag = 0: n = n + 1 FOR r = 1 TO 5: d$(r) = "": cnt(r) = 0: NEXT FOR r = count TO 1 STEP -1 p = temp(1, r) REM search for n th member of each division cnt(divs(p)) = cnt(divs(p)) + 1 IF cnt(divs(p)) = n THEN d$(divs(p)) = runners$(p): pts(divs(p)) = points(0, p): flag = 1 NEXT IF flag = 1 THEN FOR r = 1 TO 5 IF d$(r) <> "" THEN PRINT #1, TAB(30 * r - 30); j$(n); " "; d$(r); TAB(30 * r - 8); j2$(pts(r)); END IF NEXT PRINT #1, END IF LOOP PRINT #1, PRINT #1, "If any of the above information is incorrect or missing, inform Dicka as soon as possible." PRINT #1, "Remember it is YOUR responsibility to get results/times/p.b.s in within 4 weeks of the race." PRINT #1, PRINT #1, "Points are awarded as follows.." PRINT #1, "50 points to first stroller in any championship race, 49 to 2nd, 48 to 3rd etc." PRINT #1, "5 additional points for any PB in a championship race over a standard distance (5k, 10k, 10mile, 1/2 marathon, marathon)." PRINT #1, "All positions are determined by actual finishing position in the race except the marathon which is judged on time." PRINT #1, "Only the best 14 results from 17 races count, unless there is a tie when the remainder will be taken into consideration" PRINT #1, "Should 2 or more races be removed from the championship then only 2 further races may be dropped by each member." PRINT #1, "Any race clashing with a NEHL race will be removed from the championship." PRINT #1, PRINT #1, "List of championship races :" PRINT #1, "Woody's 5k Jan 23" PRINT #1, "Mile time trial Feb 16" PRINT #1, "Dentdale 14mile Mar 11" PRINT #1, "Blyth 10mile Apr 30" PRINT #1, "Keswick 1/2M May 7" PRINT #1, "Blaydon Friday Jun 9" PRINT #1, "Echo 5k " PRINT #1, "Penshaw hill" PRINT #1, "James Heriot 1/2" PRINT #1, "Tynedale 10k" PRINT #1, "Darlington 10k Aug 27" PRINT #1, "Thropton Fell Sep 17" PRINT #1, "Houghton Feast" PRINT #1, "Fruitbowl 7M Oct 17" PRINT #1, "Richmond 10k Oct 29" PRINT #1, "Loftus Dec 17" PRINT #1, "Any marathon" CLOSE INPUT "The results are stored in text file 'CHAMP00.txt'. Print it now?", a$ IF LEFT$(a$, 1) = "Y" OR LEFT$(a$, 1) = "y" THEN rem SHELL "type champ00.txt >lpt1:" width LPRINT 255 open "champ00.txt" for input as #1 do line input#1,a$ lprint a$ loop until eof(1) LPRINT ff$: REM printer form feed END IF END racedata: REM race data, in order Race name, t/p (sort on time or position) DATA "Woodys 5K",p,"Mile time trial",t,"Dentdale 14m",t,"Marathon",t,"Blyth 10",t,"Keswick 1/2M",t DATA "Blaydon",t,"Penshaw hill",t,"Echo 5k",t,"James Heriot 1/2M",t,"Tynedale 10k",t,"Darlington 10k",t DATA "Thropton Fell",t,"Houghton Feast",t,"Fruitbowl 7mile",t,"Richmond 10k",t,"Loftus",t DATA end,end runnerdata: REM Runner data in order Name,Division, race1 time, race1 pos,pb? race2 time,race2 pos,pb? ..... REM times in form HHMMSS with no separator DATA Eddie Airson,4, 2235,11,,646,,, 15311,,, ,,, 11159,,, 14620,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Shiela Alcock,5, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Robert Allington,5,,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Ron Avery,4, 2341,16,,743,,, ,,, ,,, 11653,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Bob Blair,2, 2033,8,, 718,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Richard Bowman,1, 1759,2,, 521,,, ,,, ,,, 5911,,y, 13028,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Graeme Clazey,1, ,,, 611,,, ,,, ,,, ,,, 12903,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Ev Colgin,4, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Paul Collins,1, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Ray Collins,4, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA John Cosgrove,4, 2245,12,,713,,, ,,, ,,, 11633,,y, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Malcolm Cox,2, ,,, 630,,, ,,, 33244,,y, ,,, 14540,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Mickey Crozier,2, ,,, ,,, ,,, 33524,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Bruce Davison,5, 2314,14,,,,, 21000,,, ,,, 12421,,, 20557,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Alyson Dixon,2, ,,, 537,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Dave Dixon,2, 1956,5,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Derek Dixon,2, ,,, 619,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Paul Dixon,1, ,,, 615,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end 'DATA Alan Docherty,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Kim Easton,3, ,,, ,,, ,,, 34500,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Stuart Eggleston,3,,,, 618,,, ,,, 35439,,y, ,,, 15249,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Duncan Emmerson,3, ,,, 621,,, ,,, ,,, ,,, 20359,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Mark Feeley,1, ,,, ,,, ,,, 33300,,y, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Norman Felce,5, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Tony Gair,4, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Roger Garrington,4,,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Colin Glass,4, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Emma Grant,3, 2430,20,,548,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Bill Hitchcock,5, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Steve Hobday,1, 1900,4,, 615,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Tony Howe,5, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Lesley Jackson,3, 2300,13,,,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Paul Lavender,1, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Ian Maxwell,3, 2117,9,, 641,,, 20231,,, ,,, 11121,,, 20018,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Sandra Maxwell,4, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Ken Maynard,1, ,,, 542,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Wilson McKnight,2, ,,, 641,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Peter McManus,1, ,,, 541,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Gerry O'Brien,2, 2017,7,, 622,,, ,,, 32045,,y, 10553,,, 13659,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Vince Oliver,1, 1750,1,, 531,,, 13730,,, ,,, 10329,,y, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Jacquie Pitt,5, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Adrian Potter,2, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end 'DATA Sean Price,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Geoff Prior,1, 1820,3,, 542,,, 13820,,, ,,, 10317,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Sandra Quinn,5, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Linda Raine,4, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Steve Ramsden,2, 2010,6,, 625,,, 14235,,, 33524,,y, 10717,,, 13923,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Mark Ricketts,3, ,,, 632,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Alan Robertson,4, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Allen Routledge,3, ,,, 651,,, ,,, 32959,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Blathnaid Ryan,4, ,,, 632,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Richie Sampson,5, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Ian Semens,3, ,,, 616,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Gavin Sword,3, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Gavin Spencer,2, ,,, 611,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Alan Tait,3, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Paul Taylor,1, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Bill Thompson,5, 2400,19,,722,,, ,,, ,,, 11709,,y, 14855,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Keith Turnbull,4, 2345,17,,742,,, ,,, 43305,,, 12059,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Phil Tweddell,4, ,,, 715,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Ken Tweedy,2, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Carol Vinter,5, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Dave Warnaby,2, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Phil Watson,1, 2135,10,,621,,, 14235,,, 34500,,, 11045,,, 14907,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Peter Watts,2, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Dave Williams,5, ,,, 720,,, ,,, ,,, 11443,,y, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Steve Wills,3, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Jack Wilson,3, ,,, ,,, ,,, ,,, 12156,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA John Wilson,5, 2353,18,,721,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Neil Wilson,3, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA John Woodward,3, 2316,15,,657,,, ,,, ,,, 11704,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA Derek Wright,1, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end rem DATA New Runner,2, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,, ,,,end DATA end,0 FUNCTION j$ (jj) REM return a right justified string of 3 characters j$ = RIGHT$(" " + STR$(jj), 3) END FUNCTION FUNCTION j2$ (n) REM return a decimal point justified string of 5 characters IF INT(n) = n THEN j2$ = RIGHT$(" " + STR$(n), 3) + " " ELSE j2$ = RIGHT$(" " + STR$(n), 5) END IF END FUNCTION FUNCTION pdata$ (tm, pb$, ps, pt) REM return a formatted string IF tm = 0 AND ps = 0 THEN pdata$ = " " ELSE a$ = ptime$(tm) IF pb$ = "Y" OR pb$ = "y" THEN a$ = a$ + "pb" ELSE a$ = a$ + " " REM pdata$ = a$ + " " + RIGHT$(STR$(ps), 2) + " " + RIGHT$(STR$(pt), 2) pdata$ = a$ + " " + RIGHT$(STR$(ps), 2) + " " + j2$(pt) END IF END FUNCTION FUNCTION ptime$ (tm) REM convert a time in the format HHMMSSS to H:MM:SS and suppress leading 0's IF tm = 0 THEN ptime$ = " " ELSE a$ = RIGHT$(STR$(1000000 + tm), 5) IF tm > 5959 THEN ptime$ = LEFT$(a$, 1) + ":" + MID$(a$, 2, 2) + ":" + RIGHT$(a$, 2) ELSE ptime$ = " " + MID$(a$, 2, 2) + ":" + RIGHT$(a$, 2) END IF END IF END FUNCTION SUB ssorttemp SHARED temp(), count FOR r% = 1 TO count - 1 mmin = temp(2, r%): p% = r% FOR t% = r% + 1 TO count IF temp(2, t%) < mmin THEN mmin = temp(2, t%): p% = t% NEXT SWAP temp(1, p%), temp(1, r%): SWAP temp(2, p%), temp(2, r%) NEXT END SUB