Input/Output of data

cwolford

New Member
Hi gurus!

I'm hoping someone can help me, Progress v8.3a04. I am trying to pull data from a table (output to cin.txt) and then place this data into a new temporary table where a user can edit the data (input from cin.txt). The code is pretty simple and straight-forward, now if I can just figure out what I'm doing wrong?

Only a portion of my data is actually being diplayed with the input. Here is a quick sample:

cin.txt looks like this:
"sample a" "06/09/00" "123.45"
"sample b" "09/09/00" "6.54"
"sample c" "05/05/00" "23.90"

so, my output to program is working fine, pulls the data out and uses just a space as the delimiter.

My input program is like this:
define temptable test1.....define my fields.....
input from cin.txt.
repeat:
create test1.
import .....
update test1.
end.

for each test1:
display text1.
end.

The result of this program only displays one line of my data. If I edit cin.txt and add 30 lines and then run this program, I'll only a handful of the actual data.....can anyone give me a clue as to what I'm missing?

TIA
CIN
 

Wilbert

New Member
Hi CIN,

When importing from a ascii-file I usually use the following without any problems:

def var lcLine as char.

input from input_file_name.
repeat:
import lcLine unformatted.
create tt-table.
assign tt-table.field1 = entry(1,lcLine)
tt-table.field2 = entry(2,lcLine)
....(etc).
end.

Of course if a field isn't a character type you have to convert it in the assign statement.

Hope this helps.
 

tdi

Progress Fan
try replacing the import and the next line to a "set <record>", if you import all the fields you exported in first place.

Any way, it seems a little odd, you put your data to a file and then retrieve from this file. (it is resource intensive, in the local system as in the network). So if you explain a little what are you doing perhaps there is a different way (note, i didn't say better, anyway :) ) to acomplish what you may be doing.

Any way, good luck, and if it's ok with you, let's work on it for a while...

Octavio
 

mpowell

Member
What about

Have you coded for the file being locked?
If a user has the file open to read into whilst someone is trying to write this could problems have you coded for this?

As a point to why you are doing this, are you exporting the file from the same application, I am doing something similar exporting to a txt and then reading it in, but it is to comunicate between a c program and my progress application.
 

mpowell

Member
What about

Have you coded for the file being locked?
If a user has the file open to read into whilst someone is trying to write this could problems have you coded for this?

As a point to why you are doing this, are you exporting the file from the same application, I am doing something similar exporting to a txt and then reading it in, but it is to comunicate between a c program and my progress application.

I use this

INPUT FROM FILENAME/PATH/WHATEVER NO-ECHO.

REPEAT:
PROMPT-FOR
proj_clock proj_user proj_nbr proj_time .

CREATE proj_tran.
ASSIGN
proj_clock proj_user proj_nbr proj_time .

END.
INPUT CLOSE.
 
Top