Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!princeton!caip!cbmvax!carolyn From: carolyn@cbmvax.cbm.UUCP (Carolyn Scheppner) Newsgroups: net.micro.amiga Subject: Re: problem with escape codes to the printer Message-ID: <417@cbmvax.cbmvax.cbm.UUCP> Date: Mon, 16-Jun-86 15:30:50 EDT Article-I.D.: cbmvax.417 Posted: Mon Jun 16 15:30:50 1986 Date-Received: Wed, 18-Jun-86 04:05:51 EDT References: <1183@garfield.UUCP> <3088@ncsu.UUCP> Reply-To: carolyn@cbmvax.UUCP (Carolyn Scheppner) Organization: Commodore Technology, West Chester, PA Lines: 50 In article <3088@ncsu.UUCP> mark@ncsu.UUCP (Mark Lanzo) writes: > >For that matter, I did not seem to have any success printing escape codes to >screen either when using BASIC. Attempts to print the escape character just >put a little square symbol up. Apparently the writers of AmigaBasic didn't >seem fit to support the standard console device driver (?). >I believe certain other control characters also printed the box symbol. >Oddly enough, some things were allowed through though. A ctrl-L caused a >clear screen, for instance. > >Any suggestions? (polite ones please :-) I'm always polite. Well ... almost always. You're right. Basic eats most console ESC sequences and instead gives you the little box. But you CAN send the standard ISO escape sequences to the printer from AmigaBasic. (See RKM Vol. 2 printer.doc for ISO sequences) Basic's printer device (LPT1: which is used by LPRINT) is flakey. It tends to munch on initial escape sequences. If you must use LPRINT, you can often get the ESC sequences thru by printing something (like a space) prior to the sequence. But there's a better way. Open a PRT: file and PRINT# to it. This example prints "hello" in NLQ mode and then in normal mode. (Note: DEN2 (NLQ on) = ESC[2"z DEN1 (NLQ off) = ESC[1"z ) ------------------------------------------------------------------------- OPEN "prt:" FOR OUTPUT AS #4 esc$ = CHR$(27)+"[" den2$ = esc$+"2"+chr$(34)+"z" den1$ = esc$+"1"+chr$(34)+"z" test$ = "hello" PRINT#4, den2$;test$ PRINT#4, den1$;test$ CLOSE 4 ------------------------------------------------------------------------- -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Carolyn Scheppner -- CBM >>Amiga Technical Support<< UUCP ...{allegra,caip,ihnp4,seismo}!cbmvax!carolyn PHONE 215-431-9180 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=