[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

1605.0. "Escape sequences from BASIC" by SANFAN::BARRETODE () Wed Aug 17 1988 19:33

    I know the Amiga is capable of using some of the same screen display
    enhancements as DEC terminals (bold, reverse, etc.) but I'm having
    absolutely no luck envoking them from AmigaBASIC.
    
    Since it's a version of Microsoft (which I've been using with my
    Robin for the last 4 years) I would think that prefixing an escape
    sequence with  CHR$(27) "[1m" (for example) should work.
    
    But it doesn't.  I get 1 character (probably a translation of the
    escape character) and [1m so it obviously isn't seeing the the ESCAPE
    character.
    
    Any ideas?
    
    Thanks,
          Terry
    
    
T.RTitleUserPersonal
Name
DateLines
1605.1I don't think you canAYOV28::ATHOMSONC'mon, git aff! /The Kelty ClippieThu Aug 18 1988 05:3417
    
    Yeah ! pain ain't it ?  I have tried all sorts of things to no avail,
    I've tried CSI - (chr$(155)+"1m"), I've tried PRINTing it directly
    i.e. PRINT chr$(155)"1m", I've tried assigning it to a variable,
    a$ = chr$(155)+"1m"
    PRINT a$
    Nothing worked !! (The little square that is printed before the
    1m is simply how the character set handles "non-printing" characters
    like the reverse question mark on a vt2xx).
    I don't think AmigaBasic uses con: to handle the screen, it seems
    to do all it's own screen handling (perhaps thats why all the screen
    updating is soooo slooow).
    
    Please post it here though, if you do find a way of getting escape
    sequences to work.........
    
    					Alan T.
1605.2Open your own CON: windowTLE::RMEYERSRandy MeyersThu Aug 18 1988 17:0835
The Amiga windowing system has three levels:

	1. Intuition windows.  These are the foundation of the windowing
	   system and support menus and gadgets.

	2. Console.device windows.  These windows are built on top of
	   intuition windows and support menus, gadgets, ANSI terminal
	   emulation.  They are accessed through Exec message passing.

	3. CON: windows.  These are built upon console.device windows
	   (so they support ANSI terminal emulation), but AmigaDOS
	   provides a file-system type of access to them (instead of
	   message passing).  Since these windows are supposed to act
	   like simple files, there is little provision for using gadgets
	   and menus with them (even though they are built on a foundation
	   that handles them!).

AmigaBasic uses Intuition windows (in a particularly brain-damaged way),
so the windows do not support ANSI escape sequences.  (I have no idea
how AmigaBasic turns the fastest PC windowing system into the slowest.
Guess Microsoft programmers are just talented.)

Your might try opening a CON: window yourself and doing I/O to it rather
than using the default window.  Something like:

	open "CON:0/0/640/200" for output as 1
	print #1, "Hello$[H";

Since I don't use AmigaBasic, I am guessing at the syntax.  I used $
to stand for the escape character; you'll have to do the right thing
(suggested in the previous replies) in order to really get the character.
If possible, you will want to open the window for simultaneous input and
output.  Don't know how you do that off hand.  Look for applicable
keywords in the BASIC Manual like "update", "inout", "readmymind",
whatever.
1605.3I know it can re done...SANFAN::BARRETODEThu Aug 18 1988 18:5515
    Thanks for the input.  I'm not really crazy about Basic myself,
    but until I figure out which is the best Pascal or Modula compiler
    for the money, I'm stuck with it.
    
    I suppose it's possible that AmigaBASIC can't do what I want but
    the solution may turn out to be something not so obvious (as you
    mentioned, opening CON: for output.  That turned out to be the solution
    to get my LA50 escape sequences to be recognized...had to open the
    printer for output as SER: but you have to supply your own carriage
    returns).
    
    Thanks for the help.
    
       Terry
    
1605.4MTWAIN::MACDONALDWA1OMM 7.093/145.05/223.58 AX.25Fri Aug 19 1988 11:412
    Speraking of BASIC, how does one alter the shape of the cursor in
    a BASIC program?
1605.5Another Basic Programmer out of the Closet!CGFSV1::WADLEIGHDave in Calgary, AlbertaFri Aug 19 1988 14:2815
    The secret to getting things like bolding, reverse video, italics,
    and much more working is to open graphics.library and call the routines
    within it.  One can also then get at things like a function to clear
    to the end of the line from the cursor position (&ClearEOL).
    
    You will need to have or build the graphics.bmap file, open the
    library, and define those functions you wish to use.  Most of these
    functions need to be passed a pointer to the current Raster Port,
    and the pointer is obtained  ala  Pointer& = Window(8).  See the
    Window command in the basic manual for details.
    
    Sounds complex, but once you've learned to access libraries once, 
    then you gain the ability to do many other Truly_Amazing things from 
    Basic.