If your data file contains string variables (created with WriteString):
If your data file is a true txt file (i.e. viewable in NotePad):
Edit: just realized you were using CloseFile wrongly, too. :)
Function Readmoddata(file$) If FileType(file$)=1 opened=ReadFile(file$) Repeat strng$=ReadString(opened) If strng$="New list" WB3D_AddGadgetItem(catagory,strng$,0,0) Until Eof(opened) CloseFile opened End If End Function
If your data file is a true txt file (i.e. viewable in NotePad):
Function Readmoddata(file$) If FileType(file$)=1 opened=ReadFile(file$) Repeat strng$=ReadLine$(opened) If strng$="New list" WB3D_AddGadgetItem(catagory,strng$,0,0) Until Eof(opened) CloseFile opened End If End Function
Edit: just realized you were using CloseFile wrongly, too. :)