Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Low level file oddities
Message
De
14/06/2004 20:12:17
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
14/06/2004 15:31:06
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00913594
Message ID:
00913694
Vues:
12
You can use the codes < pre > and < /pre > around your code (without spaces); in this case, the UT will keep the spaces you type. See the example below, in your pseudocode.

Doesn't the fputs() in the header output the empty line?

Another possibility: fputs() will always add a CR/LF combination. If your text already happens to contain CR/LF, you might get an additional line.

Perhaps it will help to step through the code in the debugger, and see what code gets executed, and what the values of relevant expressions are (mainly, the expressions that contain the output).

>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?
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform