paul102384
Programmer
- Oct 5, 2007
- 30
hi to all pb programmers,
i want to import a text file(tab delimited) to the datawindow
whereas in a text file, for every line, the first character should be letter D or H,
and then, D should be imported to 1st datawindow or dw_1 while H will go to another datawindow which is dw_2...
e.g.
H 1001 0 4894.04000
D 1002 0 4895.04000
H 1003 0 4896.04000
my codes looks like this:
docpath = w_glimport.sle_1.Text
i_open = FileOpen(docpath, LineMode!)//
i_read = FileRead(i_open, s_input)//
s_im = mid(s_input,1,1)//
IF s_im = 'H' THEN//
import = dw_1.ImportFile(Text!,docpath)//
END IF
- the problem is the import variable returns -2 which means empty file and no records or data can be imported..
can someone give me the codes to fix this problem..
tnx...
i want to import a text file(tab delimited) to the datawindow
whereas in a text file, for every line, the first character should be letter D or H,
and then, D should be imported to 1st datawindow or dw_1 while H will go to another datawindow which is dw_2...
e.g.
H 1001 0 4894.04000
D 1002 0 4895.04000
H 1003 0 4896.04000
my codes looks like this:
docpath = w_glimport.sle_1.Text
i_open = FileOpen(docpath, LineMode!)//
i_read = FileRead(i_open, s_input)//
s_im = mid(s_input,1,1)//
IF s_im = 'H' THEN//
import = dw_1.ImportFile(Text!,docpath)//
END IF
- the problem is the import variable returns -2 which means empty file and no records or data can be imported..
can someone give me the codes to fix this problem..
tnx...