Solved

CLIPPER/PRINT CODES

Posted on 1998-09-10
7
348 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

 

Author Comment

by:connerb
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In this article you will get to know about pros and cons of storage drives HDD, SSD and SSHD.
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

771 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

14 Experts available now in Live!

Get 1:1 Help Now