none
Programming Highscore help Smallbasic RRS feed

  • Question

  • Hi guys, im trying to create a program that gets information from a file and outputs in in the textwindow program in highscore order, for example in the file i have:

    David 7

    william 8

    roy 3

    How can i change the program to output the user in highest score order? e.g

    William 8

    David 7

    Roy 3

    haywan = "C:\Users\user\Desktop\class1.txt"
    LoadScores()
    score = File.GetFiles(haywan)
    Sub LoadScores  
    For i = 1 To 10
     hiscore[i] = File.ReadLine(haywan,i)
     EndFor
    EndSub
    For z = 1 to Array.GetItemCount(hiscore)
    For i = 1 To Text.GetLength(hiscore[z])
    kelb = Text.GetSubText(hiscore[z],i,1)
    If kelb = " " Then
    variable1 = i
     EndIf
    EndFor
    name = Text.GetSubText(hiscore[z],1,variable1)
    score = Text.GetSubTextToEnd(hiscore[z],variable1 + 1)
    TextWindow.WriteLine(name)
    TextWindow.WriteLine(score)
    EndFor

    Thanks


    Monday, April 27, 2015 4:49 PM

Answers

  • Programmer101-101,

    Sorry but you have posted to a forum that deals exclusively with questions/issues about customizing and programming Microsoft Project, a project management application. I suggest you delete this post and start with the following forum:

    https://social.msdn.microsoft.com/Forums/en-US/home?forum=smallbasic

    John

    Monday, April 27, 2015 6:00 PM