Solved

CLIPPER/PRINT CODES

Posted on 1998-09-10
7
350 Views
Last Modified: 2008-02-01
How do I code in my Print Codes in Clipper to set up a printer to print 8 lines per inch.  I have codes, but don't how  to do the source codes ya know?????
0
Comment
Question by:connerb
  • 3
  • 3
7 Comments
 
LVL 12

Expert Comment

by:mark2150
ID: 1010423
For CLIPPER, I know not. But easiest way is to gen a short control file and send that to the printer prior to launching clipper. I use DEBUG to create this type of file. Assume we're going to create 8LPI and that the code for the 8LPI command is <esc>L8 (made up code) Then your DEBUG session might be:

DEBUG 8LPI         'Init file name
-F 0,1000 0            'Fill mem with 0's
-A 100                   'Assemble at 100
xxxx:0100   DB 27   'Define Esc
xxxx:0101   DB "L8"   'Define rest of code
xxxx:0103   <enter>   'Stop assembly
-RCX                     'CX:BX contains bytes to save. Last inst was at 3 so that is count
3
-W                        'Tell prog to save three bytes
-Q                         'Exit debug

At this point you'll be back at DOS prompt with little 3 byte file, 8LPI

In you batch to fire clipper (or any other prog that wants 8 LPI) put:

@ECHO OFF
COPY /B 8LPI PRN
.

The /B switch is required to tell DOS to send the number of bytes given in the file size and  not to look for a <Ctrl Z> (EOF) marker.

This works well.

0
 

Author Comment

by:connerb
ID: 1010424
no disrespect intended, i appreciate your answer but i really don't know anything about debug either, i'm a mainframe programmer that got stuck with a pc project.  I would be interested in another solution that might be a little easier to understand.  Or if anyone knows of a tech-support # for Clipper, maybe that would help?
thanks for the time.
0
 

Accepted Solution

by:
asthalas earned 100 total points
ID: 1010425
The easiest way to send escape chars in Clipper is by:
(sorry, don't remember the semantics of Clipper)
Set output to printer
print (i think it was an ? sign) chr(27)+the rest of the codes (27 is the ascii for escape)
The trick is to use the ascii codes with the chr() function to send the non-printable chars to the printer. Well, at least that worked for me with a PCL printer some years ago.
Hope it helps.
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

Author Comment

by:connerb
ID: 1010426
Well i got that to compile,  I haven't acutally tried it on the printer(at another sight) so i'll have to test it tomorrow, thanks a lot, maybe you know what the chr() for 'C' is??
0
 

Expert Comment

by:asthalas
ID: 1010427
Ascii is exactly a byte long, so I guess you could use itoa(ascii_code) to make it a char, or, even easier, just try something like:
char ESCAPE = 27;
(I'm no too good with C, either! :)
0
 

Expert Comment

by:asthalas
ID: 1010428
I just understood what you asked (Sorry, my English is not too good...) the ASCII for 'C' (uppercase) is 67 (A=65, B=66 etc.) Anyway, you can get an ascii table in any DOS programmer's handbook :)
0
 

Author Comment

by:connerb
ID: 1010429
asthalas, hay thanks a lot, i feel quite stupid now for not knowing that, being that i'm a programmer and all,  Well I spent 3 days searching the net for an answer to my problem, then found this sight and got it answered in a few hours!!  This sight is great!
Thanks for all the help experts..
i'll probably be back soon=-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Advice on suitable tablet device. 13 89
Thoroughly Clean Mac Pro Mid 2012 8 60
Which memory brick is defective ? 8 71
nexus filter logs 3 28
Is it worth it to buy an Echo? In a word, yes! For me it was definitely worth it. I use mine on a daily basis. Prologue & Privacy At first, I was very skeptical about the Amazon Echo. In general, I don't like voice assistants. I don't li…
Moving your enterprise fax infrastructure from in-house fax machines and servers to the cloud makes sense — from both an efficiency and productivity standpoint. But does migrating to a cloud fax solution mean you will no longer be able to send or re…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now