Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Send a text file containing CHR(12) 's to the printer .
Message
 
À
14/10/2000 20:45:52
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00429558
Message ID:
00429638
Vues:
20
Trey:

I had been approching it from this angle - reading it into a report, etc., BUT had gotten off track with the pagination logic. I'll try your suggestion. Thanks for the feedback. See you tomorrow!!! (It's raining here - at last. Bring your duck suit).

-Bruce


>>I have some text files, generated by another program, that need to be printed from within my VFP application. These text files contain embedded CHR(12)'s where each page break should occur. (Line width is already limited to 80 characters, so that's no problem.)
>>
>>How can files like these be printed programmatically without losing the pagination?
>
>Hey bro!
>
>Does it need to print out straight from the text file?
>
>If not, pull the file into a cursor first and run a report on it.
>To keep the page breaks, add a grouping column to the cursor (e.g., igroup)
>Add a grouping to the report on this grouping column and start each group on a new page.
>
>Then replace the igroup field with a new group for each page break and earlier records.
>In this example, the field with the CHR(12) is MyField2:
>
CREATE CURSOR cuReport (MyField1 c(10), MyField2 c(10), igroup i)
>APPEND FROM mytext TYPE DELIMITED
>lnGroup = 0
>SCAN
>  REPLACE igroup WITH lnGroup
>  IF CHR(12) $ myfield2
>    REPLACE myfield2 WITH STRTRAN(myfield2,CHR(12))
>    lnGroup = lnGroup + 1
>  ENDIF
>ENDSCAN
>GO TOP
>
>If it does need to print straight from the file, it may depend on the printer having a page break character it uses and then replacing CHR(12) with this character in the file.
>
>See ya next week!
"Problems cannot be solved at the same level of awareness that created them." - Albert Einstein

Bruce Allen
NTX Data
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform