This is one method you might want to look at:
dim hiname$(10) : dim hiscore(10)
ClearHiScore()
SetHiScore(1000,"Mr X")
SetHiScore(1,"I'm Crap!")
SetHiScore(45,"I Missed")
SetHiScore(1234,"I'm Good")
SetHiScore(4563,"I'm Best")
for i = 1 to 10
text 0,i*16,hiname$(i) : text 100,i*16,str$(hiscore(i))
next i
wait key : end
function SetHiScore(score,name$)
if score > hiscore(10)
hiscore(10) = score
hiname$(10) = name$
rem --- sort hiscore table
i = 10
repeat
if hiscore(i) > hiscore(i-1)
t = hiscore(i)
hiscore(i) = hiscore(i-1)
hiscore(i-1)= t
t$ = hiname$(i)
hiname$(i) = hiname$(i-1)
hiname$(i-1)= t$
endif
i = i - 1
until hiscore(i) <= hiscore(i-1) or i = 1
endif
endfunction
function ClearHiScore()
for i = 1 to 10
hiscore(i) = 0
hiname$(i) = "....."
next i
endfunction
Hope it helps
Programming anything is an art, and you can't rush art.
Unless your name is Bob Ross, then you can do it in thirty minutes.