IOException when using TextInputStream.Open

Hi,

I am getting an IOException # 21 on Tis=TextInputStream.Open(f)
It was working fine with FolderItem.OpenAsTextFile.
Can anyone help me?
Here is my code below :

[code] dim Tis As textInputStream
dim rowfromfile As string
dim f, ff As folderItem
dim n,tr,l,i,res,res2,j,nbF,k As Integer
dim chem As String
dim w as progress
w=new progress

lblisting.SortedColumn=2
lblisting.Sort
f=SelectFolder

if f=nil then
msgbox “Pas de fichiers!”
beep
return
end if
nbF=f.count
w.show
w.PBProgress.Maximum=nbf

for k= 2 to nbf
'chem=f.Item(k).abso
chem=f.Item(k).NativePath
ff=GetFolderItem(chem,3)
if ff=nil then
msgbox “Pas de fichiers!”
beep
return
end if

Tis=TextInputStream.Open(f)
tis.encoding=encodings.macroman[/code]

Thanks

Chris

The line:

Tis=TextInputStream.Open(f)

looks as though it is trying to open folder as a text stream, as opposed to a file.

you are right, I probably forgot the second f when I changed the deprecated form. It should be Tis=TextInputStream.Open(ff).
Now it’s working.
Thanks a lot Mark

No worries. I often find my bugs are a single character out of place… drives me nuts hunting them down sometimes.