Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 11:19 01 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 without NL/CR

Author Message
atmega8

Guru

Joined: 19/11/2013
Location: Germany
Posts: 724
Posted: 04:48pm 04 Nov 2022
Copy link to clipboard 
Print this post

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: Canada
Posts: 116
Posted: 04:59pm 04 Nov 2022
Copy link to clipboard 
Print this post

@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: Germany
Posts: 1233
Posted: 05:50pm 04 Nov 2022
Copy link to clipboard 
Print this post

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: Germany
Posts: 724
Posted: 12:29pm 05 Nov 2022
Copy link to clipboard 
Print this post

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: Germany
Posts: 1233
Posted: 12:40pm 05 Nov 2022
Copy link to clipboard 
Print this post

  atmega8 said  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...

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 Zealand
Posts: 2442
Posted: 12:47pm 05 Nov 2022
Copy link to clipboard 
Print this post

do
  print timer chr$(10);
loop



cheers,
rob   :-)
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4044
Posted: 01:37pm 05 Nov 2022
Copy link to clipboard 
Print this post

  robert.rozee said  
do
  print timer chr$(10);
loop



cheers,
rob   :-)

Oh... I was thinking

do
  print timer chr$(13);
loop


John
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1233
Posted: 02:11pm 05 Nov 2022
Copy link to clipboard 
Print this post

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 Zealand
Posts: 2442
Posted: 02:28pm 05 Nov 2022
Copy link to clipboard 
Print this post

  JohnS said  
  robert.rozee said  
do
  print timer chr$(10);
loop



cheers,
rob   :-)

Oh... I was thinking

do
  print timer chr$(13);
loop


John


oops, you're right!


cheers,
rob  :-)
 
atmega8

Guru

Joined: 19/11/2013
Location: Germany
Posts: 724
Posted: 02:41pm 05 Nov 2022
Copy link to clipboard 
Print this post

Hallo,

thank you to all.

Funny Mandelbrot Programm;-)


THX
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 08:20pm 05 Nov 2022
Copy link to clipboard 
Print this post

  atmega8 said  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...

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
PRINT "Time =  ";
DO
PRINT TIME$;
PAUSE 1000
PRINT backspace8$;

LOOP


Jim
VK7JH
MMedit
 
atmega8

Guru

Joined: 19/11/2013
Location: Germany
Posts: 724
Posted: 01:21pm 06 Nov 2022
Copy link to clipboard 
Print this post

  TassyJim said  
  atmega8 said  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...

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
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 Kingdom
Posts: 162
Posted: 03:49pm 06 Nov 2022
Copy link to clipboard 
Print this post

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: Germany
Posts: 1233
Posted: 03:58pm 06 Nov 2022
Copy link to clipboard 
Print this post

  Bowden_P said  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.

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 Kingdom
Posts: 162
Posted: 05:00pm 06 Nov 2022
Copy link to clipboard 
Print this post

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.
 
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