Page 1 of 1

Outputting into console without a newline?

Posted: Sun Feb 22, 2015 8:46 pm
by jalih
Is it possible to output a character into console without outputting a newline. My interpreter would need such a functionality.

Re: Outputting into console without a newline?

Posted: Sun Feb 22, 2015 9:05 pm
by jalih
Initial version is running and outputting into screen for now.

Re: Outputting into console without a newline?

Posted: Mon Feb 23, 2015 8:46 am
by Bugala
you probably know this already, but would a workaround of joinig strings together work out?

example:

Code: Select all

x=1
y=2
string="X:"..x.."Y:"..y
debugprint(string)

Re: Outputting into console without a newline?

Posted: Mon Feb 23, 2015 9:33 am
by jalih
Bugala wrote:you probably know this already, but would a workaround of joining strings together work out?
That won't work as the interpreters simple virtual machine is executing a byte code, where printing of a string literal is encoded as a sequence of 'wrc character' op-codes to print character at a time followed by a 'wrl' op-code to print the line feed at the end.

I will add a string and real data types in the near future. Also Pascal style grammar will probably change into something more REXX like. Arrays will be implemented using stem array style notation:

Code: Select all

array1.10: integer;
array2.20.20: integer;

Re: Outputting into console without a newline?

Posted: Mon Feb 23, 2015 3:00 pm
by jalih
Here is a little compiled demo for testing purposes on AmigaOS4, MorphOS and Windows.

It takes "-i filename" as parameter and test.pas and primes.pas files are included for testing purposes.

Re: Outputting into console without a newline?

Posted: Tue Feb 24, 2015 4:21 pm
by airsoftsoftwair
jalih wrote:Is it possible to output a character into console without outputting a newline. My interpreter would need such a functionality.
Unfortunately, it isn't. If you had asked this two weeks earlier, I could have implemented it for 6.0 because it's obviously pretty trivial but now I'm afraid you'll have to wait until the next update...