printing text, simple question

BlitzMax Forums/BlitzMax Programming/printing text, simple question

z80jim(Posted 2008) [#1]
I'm printing lots with individual print commands in a loop, and I want all of these to appear on the same line... I am accustomed to simply putting a semicolon at the end of the text to keep it from printing again at the next line, but this doesn't seem to be working... I've searched fruitlessly through the blitzmax help too, can't find anything there.


Amon(Posted 2008) [#2]
global Text1:string = "hello"
global Text2:string = "My Name"
global Text3:string = "Is Earl!"

Drawtext Text1 + " " + Text2 + " " + Text3,0,0

or

Print Text1 + " " + Text2 + " " + Text3


jsp(Posted 2008) [#3]
StandardIOStream.WriteString "Hello World"
StandardIOStream.WriteString " End~n"


tonyg(Posted 2008) [#4]
No really simple answer I am afraid.
For Local x:Int= 1 To 50
	StandardIOStream.WriteString x
	If x =25 StandardIOStream.WriteString "~n"

Next


or
For Local x:Int= 1 To 50
	WriteStdout x
	If x =25 WriteStdout "~n"

Next



z80jim(Posted 2008) [#5]
thanks but I don't think you guys are quite understanding :( I'm talking hundreds of variables in an array, I'm not going to take the time to do print array[0,0], etc..
and jsp I didn't understand what you did there can you please explain?


tonyg(Posted 2008) [#6]
Print command adds a newline character to each line.
WriteStdout does not.
"~n" adds a newline character.


z80jim(Posted 2008) [#7]
ugh well I'll try the code then thx guys


jsp(Posted 2008) [#8]
What tonyg said.

Start Loop
StandardIOStream.WriteString "All your prints without newline"
End Of Loop

'New Line
StandardIOStream.WriteString "~n"


z80jim(Posted 2008) [#9]
problem solved thanks all :)
now I have another question.... how do I print a quote character? It won't let me because then, of course you have a misplaced quote sign :(


Retimer(Posted 2008) [#10]
chr(34)


jsp(Posted 2008) [#11]
"~n" stands for newline
"~q" for quote
"~t" for tab
...


z80jim(Posted 2008) [#12]
thanks again :)
I have updated the level editor... you can now add your own maps. Simply make it in the tilemapeditor, press 7, and it will give you the whole map in defdata's via print and exit. Simply copy all that over to mario and run it!