Read File using ReadDelim problem


simonwachira

Recommended Posts

Posted

I am trying to read a text file using the code below but it give s me an error :

F0001 An unspecified error occurred.: readdelim_test Line 8 - Uncaught error in sequence readdelim_test

line no 8 is:  simon = file.ReadDelim(FileHandle,-1,",",chr(13),0,0) 

***********start of code*************************

private simon 

private FileHandle = file.Open("C:\Users\Simon\Dropbox\KOFC\DAQfactory\write_delim.txt",0,1,0,1)
simon = file.ReadDelim(FileHandle,-1,",",chr(13),0,0)   (this is line number 8)
file.Close(FileHandle)

system.MessageBox(simon)

*******************end of code******************************

write_delim.txt

Posted

The problem is that you opened the file with only "Write" attributes, so DAQFactory can't actually do a read.  You need to do file.open() with 1,0,0,1 instead of 0,1,0,1.  The order goes: Read, Write, Append, Text.

 

 

Archived

This topic is now archived and is closed to further replies.