Page 1 of 1

Printing on screen.

Posted: Thu Sep 26, 2019 3:29 am
by hessu
In tex Liberty basic I write:

a=5
print"number is ";5
and I get number is 5

How can I do that in Pure basic
the command debug is so confusing

Re: Printing on screen.

Posted: Thu Sep 26, 2019 4:16 am
by idle

Code: Select all

a = 5 
Debug "number is " + Str(a) 

OpenConsole() 

PrintN("number is " + Str(a))

Input() 

CloseConsole() 

Re: Printing on screen.

Posted: Thu Sep 26, 2019 6:48 am
by Marc56us
:idea: Even shorter: no need Str() in some cases 8)

PB does an automatic number transtyping if the line starts with a string
(even if empty string "")

Code: Select all

a = 5
Debug "number is " + a

OpenConsole()

PrintN("number is " + a)

Input()

CloseConsole() 
:wink:

Re: Printing on screen.

Posted: Thu Sep 26, 2019 7:24 am
by hessu
Thank you.

:mrgreen:

Re: Printing on screen.

Posted: Thu Sep 26, 2019 1:27 pm
by Tenaja
Note that debug should not be used for final programs, only for debugging.

Re: Printing on screen.

Posted: Thu Sep 26, 2019 8:49 pm
by mk-soft

Code: Select all

a = 1
Debug "1+1 is not 2, it's " + a + 1
:mrgreen:

Re: Printing on screen.

Posted: Thu Sep 26, 2019 9:02 pm
by skywalk
Best to always format your numbers and not rely on implied behavior.
Use str(),strD(),roll your own, etc.