Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Low level file oddities
Message
De
14/06/2004 15:31:06
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Low level file oddities
Divers
Thread ID:
00913594
Message ID:
00913594
Vues:
56
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform