Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Proper way to copy a file to a parallel port
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00212568
Message ID:
00212648
Vues:
36
Hi Stephen

I am using a cognitive solutions barcode blaster printer. All you do is send it a text file with parameters and then the printer prints the barcode.

Now I do the following:
cPrinter = getprinter()
set printer to cPrinter
set printer on
? "! 0 120 75 1"
? "PITCH 100"
? "VARIABLE FEED_TYPE GAP"
? "STRING 8X8 35 0 LESSON SCHEDULER"
I have determined that there is a blank line that gets printed first and I can't have this happening. The Blaster requires that the exclamation point be the first character.

The way I determined this was happening is that I set the printer to a file and then looked at the file.

Any ideas?

Thanks,
Paul


>>I have a utility that creates a text file and then copies this file to the parallel port by issuing the command "copy file 'file.txt' to 'lpt1'". This works fine because the barcode printer receives the file and prints the label properly. However, I get an error message that states the file cannot be created. I assume this error is because VFP cannot create a file called "lpt1"?
>>
>>Is there a better way to handle this scenario?
>>
>>Thanks,
>>Paul
>
>
>Its a dos trick that I use, here is a batch file that I run:
>
>mode lpt1=com1
>mode com1 96,n,8,1,p
>shiplabl
>
>where shiplabl is the EXE.
>
>
>here is the printing code:
>SET PRINTER ON
> SET PRINTER TO LPT1
>
>I then print line by line to the printer
>
>? CHR(2)+CHR(76)+CHR(87)+CHR(72)+CHR(16)+CHR(13)
>? "1X1100000000005B443225002002"+CHR(13)
>? "1X1100001120005L448002"+CHR(13)
>? "131100001950008FROM"+CHR(13)
>? "131100000840008 TO"+CHR(13)
>? "121100001980082"+_shipco+CHR(13)
>? "121100001700082"+_shipcoadr+CHR(13)
>? "121100001420082"+_shipcstzp+CHR(13)
>? "121100001140082"+" "+CHR(13)
>
>
>You can add the same parameters for your system. I find it strange that a barcode printer will work on LPT1. Also is your printer cable designed to work with your printer? I have to purchase special cables for my printers {barcode.}
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform