[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference hydra::amiga_v1

Title:AMIGA NOTES
Notice:Join us in the *NEW* conference - HYDRA::AMIGA_V2
Moderator:HYDRA::MOORE
Created:Sat Apr 26 1986
Last Modified:Wed Feb 05 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:5378
Total number of notes:38326

1837.0. "Editing <esc> characters into my text." by LEDS::BUSCH (Dave Busch at NKS1-2) Mon Oct 31 1988 12:27

I'd like to include an "ECHO >PRT: <string>" command to my startup-sequence so 
that I can set my printer to do wonderful things. Using ED, how do I include an 
<esc> character in the string? Whenever I type <esc>, ED interprets it as an ED 
command. Is there a way to mask the <esc>?

Dave

T.RTitleUserPersonal
Name
DateLines
1837.1ECHO has ESCAPE built in!WJG::GUINEAUMon Oct 31 1988 14:2710
with ECHO, you can include escape sequences in the string.

ECHO >PRT: "*[1mbold print*[0m"

I think just the "*" is required to get an ESCAPE character in ECHO's output.

Anyone?

John
1837.2*E[ will do itFSDEV1::JBERNARDMon Oct 31 1988 16:316
    with V1.3
    
    ECHO >PRT: "*E[1m This is Bold type. *E[22m This is Normal."
    
    Should work fine.
    
1837.3LEDS::BUSCHDave Busch at NKS1-2Mon Oct 31 1988 18:369
                              -< *E[ will do it >-
<    with V1.3
<    ECHO >PRT: "*E[1m This is Bold type. *E[22m This is Normal."
<    Should work fine.
    
How about with 1.2? I'm still waiting for The Mem Loc and/or the Software Shop 
to get their next shipments in.

Dave
1837.4Works with 1.0, 1.1, 1.2, 1.3TLE::RMEYERSRandy MeyersMon Oct 31 1988 19:346
Re: .3

The *E is strings to get an escape character is an undocumented feature
of echo since day one of the Amiga.

I believe that syntax comes from BCPL.
1837.5How does this relate to documented esc codes?CAM::ARENDTDDT - The first and still the bestTue Nov 01 1988 17:1734
    
    
    I am interested in this topic however I cannot for the life of me
    figure out what you are talking about. I tried the aforementioned
    procedure on my A2000 and sure enough the type face changed however
    that is where my understanding of the technique involved stopped
    dead.  I have an Epson RX-80 printer with many fancy features none
    of which I have used due to the very problem that was asked ( I
    actually considered buying Wordperfect on the basis of it's printer
    handling )
    
    My problem is that the example seems to have nothing to do with
    the Epson documentation which I possess.  For example my manual
    has several enhnaced print modes, none of which is called "BOLD"
    the escape codes given ion the manual are;
    
    <ESC>"M"    Turns Elite mode on 
    <ESC>"P"    Turns Elite mode off
    <ESC>"G"    Turns Double Strike mode on 
    <ESC>"H"    Turns Double Strike mode off 
    <ESC>"-1"   Turns Underline mode on 
    
    And so on,
    
    These do not seem to work with the described technique and the
    technique does not map into them.  Does anyone have an explaination
    for this?
    
    Also does word perfectd really handle all this stuff?
    
    Thanks in advance
    
    Harry who_is_somewhat_confused_and_is_still_learning
    
1837.6Like this???FSDEV1::JBERNARDTue Nov 01 1988 18:1647
    Ah... this is where the printer handler rears its ugly head...
    
    
    you should be able to talk to your printer in two ways...
    
    
    BRUTE FORCE
    
    You could create a file with an editor and send it to the SER: or
    PAR: port, where ever your printer resides... by  
    COPY file.ext SER:
    
    <ESC>[4m turn on wide print   blah blah
    <ESC>[0m  turn off whatever you turned on  etc etc etc...
    
    
    
    Or by using the "Standard" Amiga printer escape codes listed in
    the back of your A2000 book...
    
    and printing the file through the PRT: device using whatever
    application you are in.
    
    
    Why the codes don't match your printer manual is illustrated below...
    
    
    
    File                Printer Driver                 Printer
     or
    Application
    
    
    Uses "Standard"      Convert from "Standard        Gets sent the
        AMIGA            printer code to device        device specific
    printer codes        specific code                 code required
                                                                    
    
    
    
    At least this is how I understand it....
    
    John
    
    i.e. [[32m
    
    
1837.7End-of-form / bottom margin.LEDS::BUSCHDave Busch at NKS1-2Tue Nov 01 1988 19:4126
Precisely. What I am attempting to do is initialize or "preset" certain features
in the printer that there is no way to do with preferences. Specifically, Prefs
allows one to set page length to 66 lines per page (default) but doesn't allow 
for skipping the perforation at the bottom of the page, ie. no bottom margin. 
What I want to do is:

	1. Select a font (the NX-100 has draft and 3 NLQ's).
	2. Specify bottom margin so that only 60 lines will be printed per page.
	3. Set the left margin so I can punch holes and not lose data.
	4. Set pitch to 12 cpi so I don't lose data or wrap around.
	5. Tell prefs to print 100 characters per line so the driver won't 
	   insert automatic carriage-return/line-feed's.

Preferences only allow me to control items 3-5. I intend to add the "echo" 
commands to my startup.sequence file at the very end. I hope that by then the 
"printer.init" will have done it's thing and won't reset my settings. 

There are many other features, such as double or quad size printing, which I 
might want to set simply by sending a string to the printer.

BTW, in Pro-Write there is no way to specify to the program that you are using 
paper other than 11" long. If you want to use personal stationery and have the 
program know when it has gotten to the bottom of the page, it is necessary to 
define a footer of a specified length and then leave it blank. What a drag.

Dave
1837.8MTWAIN::MACDONALDWA1OMM 7.093/145.05/223.58 AX.25Wed Nov 02 1988 14:393
    Well, there is a nice program called PRINT2.ARC in PAULY"AMIGA"::
    that allows you to alter all your printer characteristics with a
    CLI command.
1837.9How to enter "control-characters"?LEDS::BUSCHDave Busch at NKS1-2Sun Nov 06 1988 04:4315
Re .5
    
    <ESC>"-1"   Turns Underline mode on 

My next problem is illustratecd in the above request. In hex, the string should
look like "1B 2D 01". Using the echo command in startup-sequence allows me to 
insert the "1B" <esc> by entering "*E" and I can enter the "2D" with a "-" but 
if I want to send the code to the printer without going through the driver I 
have to send it via "echo >par:". The only way I know to send the "01" is by 
entering "ctrl-A", which the editor won't let me do. Is there another 
"unpublished" trick for entering "control" characters? The DOS manual says that
ED can't do it and if I want to enter/edit binary data I have to use EDIT but 
the documentation didn't say how to enter control-characters.

Dave
1837.10Unless I missed somethingWJG::GUINEAUMon Nov 07 1988 11:425
I believe in <esc>"-1"  the "1" is the ASCII character "1" and not the binary
value 01.

John
1837.11Can't edit binary data.LEDS::BUSCHDave Busch at NKS1-2Mon Nov 07 1988 13:1712
<	I believe in <esc>"-1"  the "1" is the ASCII character "1" and not 
<	the binary value 01.

Not so. I really need to enter binary "01". Many of the printer's special codes 
use a binary value for a count parameter, such as "58" for the decimal 88 when I
want to tell the printer to print 88 lines per page. Trouble is, although hex
"58" is easy to enter (ascii "X") low numbers like "01" aren't. I can enter
"ctrl-A" directly in an "echo" command but I can't enter it into a command file
with the editor.  HELP. 

Dave. 

1837.12Use EMACS ^Q^AAYOV28::ATHOMSONC'mon, git aff! /The Kelty ClippieMon Nov 07 1988 13:5011
1837.13MTWAIN::MACDONALDWA1OMM 7.093/145.05/223.58 AX.25Thu Nov 10 1988 15:2516
    COPY * PRINTER.SETUP
    
    
    Use this command to send keyboard input, including ESC character
    directly to the file named PRINTER.SETUP. When you are finished
    entering ESC sequences for your printer, type CTRL\ (CONTROL key
    and BACKSLASH character together).

    Next, add this command to your startup-sequence file:
    
    COPY PRINTER.SETUP PRT:
    
    That will send the printer setup codes in PRINTER.SETUP to your
    printer automatically. I use this all the time.
    
    Paul
1837.14form feedGILBRT::BEAUREGARDRoger Beauregard SHR1-3Thu Dec 01 1988 15:4014
    I tried using the afore mentioned method of sending esc characters
    to my printer (echo >par: "*En"). I would like to be able to send
    form feed commands to my printer in this fasion. I have a NEC P2200
    which uses an ascii "FF" as the form feed command rather than an
    esc sequence. How, from a script file, can I send a form feed command.
    I tried copy * >prt: and then cntl L (on the keyboard) which I believe
    is the form feed control sequence used most of the time. Is there
    some other control sequence that will cause a form feed. 
    
    Thanks
    
    Roger