All I want to do is open and read from a text file that contains a series of comma delimited text lines. The filename is fixed (“wisparam.txt”) and there is no user interaction to select it - it is hardwired into the code. I can’t figure out how to open the file correctly so it can be read from.
I tried:
dim infile as folderitem
infile=“wisparam.txt”
dim input as TextInputStream
input=TextInputStream.open(InFile)
But I get an error that says Type mismatch. Expected class FolderItem, but got TextLiteral infile=”wisparam.txt”
In my old QBASIC programming days, I’d open a file just by:
You are close. I remember QBASIC too. But Xojo starts to make sense after a while.
All of these do the same thing:
'option 1
var inFile as FolderItem
inFile = New FolderItem(“c:\abc\winsparam.txt”, FolderItem.PathModes.Native)
var ti as TextInputStream
ti= TextInputStream.Open(inFile)
'option 2
var inFile2 as New FolderItem(“c:\abc\winsparam.txt”, FolderItem.PathModes.Native)
var ti2 as TextInputStream = TextInputStream.Open(inFile2)
'option 3
var ti3 as TextInputStream = TextInputStream.Open(New FolderItem(“c:\abc\winsparam.txt”, FolderItem.PathModes.Native))