Solved

CLIPPER/PRINT CODES

Posted on 1998-09-10
7
354 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
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 

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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

this article is a guided solution for most of the common server issues in server hardware tasks we are facing in our routine job works. the topics in the following article covered are, 1) dell hardware raidlevel (Perc) 2) adding HDD 3) how t…
A clone is a duplicate copy. Sheep have been cloned and maybe someday even people will be cloned, but disk cloning (performed by the hard drive cloning software) is a vital tool used to manage and protect data. Let’s look at what hard drive cloning …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

809 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