![]() |
Forum Index : Microcontroller and PC projects : Picomite Print without NL/CR
Author | Message | ||||
atmega8![]() Guru ![]() Joined: 19/11/2013 Location: GermanyPosts: 724 |
Hi, how can i achieve this in a Console Session? THX Edited 2022-11-05 02:57 by atmega8 |
||||
Hans![]() Senior Member ![]() Joined: 18/10/2022 Location: CanadaPosts: 116 |
@atmega8 Hi; This is a newbe talking but is the ; after a print not what you are looking for? Please clarify…… Hans … ![]() |
||||
Martin H.![]() Guru ![]() Joined: 04/06/2022 Location: GermanyPosts: 1233 |
you get a Print without NL/CR if you just end your Print Statement with a Semicolon for CH%=32 to 128:Print chr$(CH%);:next CH% 'no comment |
||||
atmega8![]() Guru ![]() Joined: 19/11/2013 Location: GermanyPosts: 724 |
Hello, I was probably a little bit too imprecise with my description. I would like to achieve that the characters are always written in the same place. Print values ??such as the time from the beginning of the prompt so that the new time overwrites the old one. I don't think this can be done natively with the MMBASIC Print command and its parameters. You probably have to use escape sequences. Is there an example? Thanks very much... |
||||
Martin H.![]() Guru ![]() Joined: 04/06/2022 Location: GermanyPosts: 1233 |
here some usefull subs 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 'Cursor to Position 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 |
||||
robert.rozee Guru ![]() Joined: 31/12/2012 Location: New ZealandPosts: 2442 |
do print timer chr$(10); loop cheers, rob :-) |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4044 |
Oh... I was thinking do print timer chr$(13); loop John |
||||
Martin H.![]() Guru ![]() Joined: 04/06/2022 Location: GermanyPosts: 1233 |
sum fun with the Terminal 'mandelbrot ' 'inspired by Matt Heffernan s 8-BIT BATTLE 'https://www.youtube.com/watch?v=DC5wi6iv9io 'for PicoMite is a Raspberry Pi Pico running the free MMBasic interpreter. 'and Putty Tera Term or other VT100 Terminal emulation '2022 by M. Herhaus ' 'clear screen, home and cursor off Print Chr$(27);"[2J";Chr$(27);"[H";Chr$(27);"[?25l";Chr$(27);"(0"; Time$="00" ' max x and max y DX=32:DY=22 For py=0 To DY-1 For px=0 To DX-1 xz=px*3.5/DX-2.5 yz=py*2/DY-1 x=0 y=0 For i=0 To 14 If x*x+y*y>4 Then Exit For xt = x*x - y*y + xz y= 2 * x * y + yz x=xt Next i Print Chr$(27);"[";Str$(py+1);"H";Chr$(27);"[";Str$(px+1);"G"; 'at py+1,px+1 If i<8Then Print Chr$(27);"[";Str$(39+i);"m "; Else Print Chr$(27);"[";Str$(32+i);"ma"; EndIf Next px Next py 'cursor on Print Chr$(27);"[40m";Chr$(27);"[?25h";Chr$(27);"(B":Print Time$ 'no comment |
||||
robert.rozee Guru ![]() Joined: 31/12/2012 Location: New ZealandPosts: 2442 |
oops, you're right! cheers, rob :-) |
||||
atmega8![]() Guru ![]() Joined: 19/11/2013 Location: GermanyPosts: 724 |
Hallo, thank you to all. Funny Mandelbrot Programm;-) THX |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
I was probably a little bit too imprecise with my description. I would like to achieve that the characters are always written in the same place. Print values ??such as the time from the beginning of the prompt so that the new time overwrites the old one. I don't think this can be done natively with the MMBASIC Print command and its parameters. You probably have to use escape sequences. Is there an example? Thanks very much... escape sequences are the most reliable but depending on the terminal program settings, backspace is an alternative. ' backspace8$ = CHR$(8)+CHR$(8)+CHR$(8)+CHR$(8)+CHR$(8)+CHR$(8)+CHR$(8)+CHR$(8) PRINT "Time = "; DO PRINT TIME$; PAUSE 1000 PRINT backspace8$; LOOP Jim VK7JH MMedit |
||||
atmega8![]() Guru ![]() Joined: 19/11/2013 Location: GermanyPosts: 724 |
I was probably a little bit too imprecise with my description. I would like to achieve that the characters are always written in the same place. Print values ??such as the time from the beginning of the prompt so that the new time overwrites the old one. I don't think this can be done natively with the MMBASIC Print command and its parameters. You probably have to use escape sequences. Is there an example? Thanks very much... escape sequences are the most reliable but depending on the terminal program settings, backspace is an alternative. ' backspace8$ = CHR$(8)+CHR$(8)+CHR$(8)+CHR$(8)+CHR$(8)+CHR$(8)+CHR$(8)+CHR$(8) PRINT "Time = "; DO PRINT TIME$; PAUSE 1000 PRINT backspace8$; LOOP Jim Also a nice Solution. Good Idea! THX |
||||
Bowden_P Senior Member ![]() Joined: 20/03/2019 Location: United KingdomPosts: 162 |
Hi Amega8, You can use the TEXT command to position the cursor on the screen, then follow with PRINT'ing your desired data :- TEXT 20,20,"Time = ": PRINT time$; If you don't want TEXT to output anything, then just use an empty string :- TEXT 20,20,"": PRINT time$; With best regards, Paul. Nothing so constant as change. |
||||
Martin H.![]() Guru ![]() Joined: 04/06/2022 Location: GermanyPosts: 1233 |
You can use the TEXT command to position the cursor on the screen, then follow with PRINT'ing your desired data :- TEXT 20,20,"Time = ": PRINT time$; If you don't want TEXT to output anything, then just use an empty string :- TEXT 20,20,"": PRINT time$; With best regards, Paul. Does not work in Terminal only mode text 20,20,"" Error : Display not configured but print @(20,20)"test" works Edited 2022-11-07 02:00 by Martin H. 'no comment |
||||
Bowden_P Senior Member ![]() Joined: 20/03/2019 Location: United KingdomPosts: 162 |
Hi Martin H, Yes, quite right. I had assumed that Atmega8 was running with an attached LCD screen. I have got the wrong end of the stick - as they say ! With best regards, Paul. Nothing so constant as change. |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |