Link to home
Start Free TrialLog in
Avatar of dmailbox
dmailbox

asked on

Conver Open "Com1" to MSCOMM

Experts, I am sending data to a barcode printer via the Open "LPT1" structure.  For some reason, which I cannot understand, the code works fine for LPT1, but only works SOMETIMES when the printer is attached to a com port (on some computers I can never get the com ports working....LPT1 always works).  I have tried for numerous hours to figure this out...but I've been unsuccessful.

What I'd like to do now is use the MSCOMM option for all com communication, but I have never used it.  How does one convert the following code to MSCOMM format?  (I now have the license for MSCOMM)

              Open PrnPort For Output As #2      'i.e. LPT1, COM1, COM2...
               
                Print #2, "N"
                Print #2, "q816"
                Print #2, "Q1218,24+0"
                Print #2, "S3"
                Print #2, "D8"
                Print #2, "ZT"
                Print #2, "TTh:m"
                Print #2, "TDy2.mn.dd"
                Print #2, "OD"
                Print #2, "LO2,55,807,12"
                Print #2, "LO6,1112,807,13"
                Print #2, "LO8,1141,805,16"
                Print #2, "LO2,114,807,16"
                Print #2, "LO4,1078,805,18"
                Print #2, "A49,201,0,4,1,1,N,""CARRIER: """
                Print #2, "A35,246,0,4,1,1,N,""LOCATION: """
                     .
                     .
                     .

              Close #2


ASKER CERTIFIED SOLUTION
Avatar of SidFishes
SidFishes
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dmailbox
dmailbox

ASKER

Fabulous!!! This code is great...and exactly what I needed.  Thank you very much SidFishes!!!