Hi Universal Thread, long time no type
VFP8
WinXP/Microsoft client/Novell networks
Here's the issue.
I have to take a data table (vouchers) and format it into a text file that our accounting system can understand (we call it the 'EDI' layout). Each record in the Voucher table can create up to 3 lines in the EDI file - Voucher Header (when the voucher number changes) and 2 Voucher Detail.
These lines MUST be in the order of:
Voucher Header
Voucher Detail Line 1
Voucher Detail Line 2
Voucher Detail Line 1
Voucher Detail Line 2
Voucher Detail Line 1
Voucher Detail Line 2
Voucher Header
etc.
I'm using low level file I/O to do this and I'm using the following logic
store voucher number into variable oldvou
SCAN Fox table
if voucher number <> oldvou
create Voucher Header (calls fputs() once)
oldvou = voucher number
else
scan while voucher number = oldvou
created Voucher Detail (creates the 2 detail lines - calls fputs twice)
endscan (voucher = oldvou)
endscan (fox table)
When I look at the resulting file,rather than seeing
Voucher Header
Voucher Detail Line 1
Voucher Detail Line 2
Voucher Detail Line 1
Voucher Detail Line 2
Voucher Detail Line 1
Voucher Detail Line 2
Voucher Header
etc.
I'm seeing
Voucher Header
Voucher Detail Line 1
Voucher Detail Line 2
Voucher Detail Line 1
Voucher Detail Line 2
Voucher Detail Line 1
Voucher Detail Line 2
Voucher Header
etc.
Sorry for the length of this, but I've never seen behaviour like this from fputs. Wassup?
"You don't manage people. You manage things - people you lead" Adm. Grace Hopper
Pflugerville, between a Rock and a Weird Place