Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 05:46 02 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Picomite Print and colour

Author Message
IanS
Newbie

Joined: 26/07/2020
Location: Germany
Posts: 19
Posted: 10:14am 20 Jun 2022
Copy link to clipboard 
Print this post

Hi,

I know this is a newbie question but when the editor can display colour using terraterm via the USB why is colour not available in the print statement or have I just not found how to do it ?

IanS
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 10:22am 20 Jun 2022
Copy link to clipboard 
Print this post

Hi Ian,

If you want colour from your serial terminal then you need to use ANSI escape codes in your PRINT statement.

See https://en.wikipedia.org/wiki/ANSI_escape_code

Print "This is " Chr$(27) "[33myellow" Chr$(27) "[0m text"


Best wishes

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
IanS
Newbie

Joined: 26/07/2020
Location: Germany
Posts: 19
Posted: 01:14pm 20 Jun 2022
Copy link to clipboard 
Print this post

Hi Tom,

yes, of course. I should really have remembered that from years ago but I had completely forgotten the ESC code system. Thanks for puting me back on track.

IanS
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7937
Posted: 01:24pm 20 Jun 2022
Copy link to clipboard 
Print this post

My little library is here.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
IanS
Newbie

Joined: 26/07/2020
Location: Germany
Posts: 19
Posted: 02:54pm 20 Jun 2022
Copy link to clipboard 
Print this post

Thanks Mick very nicely done.

IanS
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1234
Posted: 02:59pm 20 Jun 2022
Copy link to clipboard 
Print this post

some additional usefull little subs for VT100 :-)


Sub TCLS
' clear Terminal Screen
Print Chr$(27);"[2J";
 HOME
 End Sub

 Sub HOME
 ' Cursor top left
  Print Chr$(27);"[H";
  End Sub

  Sub AT Row,Col
  Print Chr$(27);"[";Str$(Row);"H";Chr$(27);"[";Str$(Col);"G";
  End Sub

  Sub cur_off
  Print Chr$(27);"[?25l";
  End Sub

  Sub cur_on
  Print Chr$(27);"[?25h";
  End Sub


'no comment
 
IanS
Newbie

Joined: 26/07/2020
Location: Germany
Posts: 19
Posted: 07:00pm 20 Jun 2022
Copy link to clipboard 
Print this post

Hi Martin,
thanks for those additional subroutines and I have added some colour to the Mastermind game I included earlier this week.


Mastermind.zip

IanS
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1234
Posted: 04:27pm 21 Jun 2022
Copy link to clipboard 
Print this post

Just saw Mixtel90s Routines, they are covering most whishes..
but we have just the cur_on - cur_off routines.
They prevents the terminal from flickering Cursor, when redrawing.  
'no comment
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025