M mjcoon Well-Known Member Licensed User Nov 10, 2012 #1 I have modified an old program of mine which has always had (successful!) file handling operations. The new file is opened, just like the others, via: B4X: FileOpen(fileTime, AppPath & "\filedTime.txt", cWrite, cAppend, cASCII) But now I am using FileReadToEnd() and FilePut() which I have not used before. When I execute either one of these, either within IDE or compiled, I get "Unable to cast" fail messages such as the one attached. What's wrong? Mike. Attachments filePut.jpg 20.7 KB · Views: 332
I have modified an old program of mine which has always had (successful!) file handling operations. The new file is opened, just like the others, via: B4X: FileOpen(fileTime, AppPath & "\filedTime.txt", cWrite, cAppend, cASCII) But now I am using FileReadToEnd() and FilePut() which I have not used before. When I execute either one of these, either within IDE or compiled, I get "Unable to cast" fail messages such as the one attached. What's wrong? Mike.
Erel B4X founder Staff member Licensed User Longtime User Nov 11, 2012 #2 FilePut can only work when you open the file in random mode.