Solved

CLIPPER/PRINT CODES

Posted on 1998-09-10
7
360 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
IoT Devices - Fast, Cheap or Secure…Pick Two

The IoT market is growing at a rapid pace and manufacturers are under pressure to quickly provide new products. Can you be sure that your devices do what they're supposed to do, while still being secure?

 

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

IoT Devices - Fast, Cheap or Secure…Pick Two

The IoT market is growing at a rapid pace and manufacturers are under pressure to quickly provide new products. Can you be sure that your devices do what they're supposed to do, while still being secure?

Question has a verified solution.

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

This paper addresses the security of Sennheiser DECT Contact Center and Office (CC&O) headsets. It describes the DECT security chain comprised of “Pairing”, “Per Call Authentication” and “Encryption”, which are all part of the standard DECT protocol.
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 …
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

622 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