I figured out how to mousedrag, but I don’t know how to load a file back into the listbox; I’ve tried this:
in listbox1.open I’ve stated the heading and column count per usual, then I have a pushbutton to add the items into the listbox and I have the labels and textfields for the categories.
Now, this is what I need help in:
I have two methods, one for loadscore and the second for savescore:
LoadScore:
Dim loadFile As FolderItem
loadFile = GetFolderItem ("/Desktop/Lexar/summative#1/newson_newson/")
If loadFile <> Nil And loadFile.Exists Then
Dim input As TextInputStream
input = TextInputStream.Open(loadFile)
mScore = Val(input.ReadLine)
input.Close
End If
SaveScore:
Dim f As FolderItem
f = GetFolderItem ("/Desktop/lexar/summative#1/newson_newson",1)
dim t as TextOutputStream
If f.Exists = False Then
t = TextOutputStream.Create(f) //create folder
End If
Dim saveFile As FolderItem
saveFile = GetFolderItem (“Newson_Newson”)
Dim output As TextOutputStream
output = TextOutputStream.Create(saveFile)
output.WriteLine(Str(mScore))
output.Close
then I have a pushbutton to save the information onto a file and its name is ‘score’ containing this code:
dim f as FolderItem
’
'f = GetFolderItem ("/Desktop/lexar/summative#1/newson_newson",1)
Dim t as TextOutputStream
if f.Exists = False then //if folder does not exist
t = TextOutputStream.Create(f) //create folder
SaveScore
else
//does exist
t = TextOutputStream.Append(f) //add on
SaveScore
end if
(My problem is that whenever I click on the ‘save’ pushbutton I am forced back into the app window and a list comes up that states that f and t have an exception of Nil now I now what that means but I don’t know how to deal with it.)
\\ I wrote about this last week but didn’t know how to edit that post thus my sincere apology for this.\\