![]() |
Forum Index : Microcontroller and PC projects : Picomite Print and colour
Author | Message | ||||
IanS Newbie ![]() Joined: 26/07/2020 Location: GermanyPosts: 19 |
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 KingdomPosts: 4311 |
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: GermanyPosts: 19 |
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 KingdomPosts: 7937 |
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: GermanyPosts: 19 |
Thanks Mick very nicely done. IanS |
||||
Martin H.![]() Guru ![]() Joined: 04/06/2022 Location: GermanyPosts: 1234 |
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: GermanyPosts: 19 |
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: GermanyPosts: 1234 |
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 |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |