Solved

CLIPPER/PRINT CODES

Posted on 1998-09-10
7
357 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
What do we know about Legacy Video Conferencing? - Full IT support needed! - Complicated systems at outrageous prices! - Intense training required! Highfive believes we need to embrace a new alternative.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

734 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