Print without starting a new line?
BlitzMax Forums/BlitzMax Programming/Print without starting a new line?
| ||
I'd like to print a line of periods to indicate a console app is processing, without starting a new line. Is this possible? |
| ||
For I = 0 To 100 StandardIOStream.WriteString "." StandardIOStream.Flush '<-- not sure if this is required Delay(100) Next |
| ||
You could try using StandardIOStream.WriteString |
| ||
or WriteStdOut("A") WriteStdOut("B") WriteStdOut("C~n") WriteStdOut("I'am a new Line") -> ABC I'am a new Line |
| ||
ziggy = teh winner. Yes, I'm psychic. |
| ||
my solution has more letters. GW <- WINNER! :) |
| ||
@Leadwerks and Vertex: WriteStdOut will not take in consideration the 'endianess' of the platform, it will make a direct string to byte conversion. StandardIOStream works as spected with all spetial and non spetial characters, using unicode encoding, the same as Print. So I would suggest to use the GW solution. Additionally, the flush command should be called to ensure your application doesn't write more than 4096 bytes to the standard output pipe, or it will get filled if the calling application is not freeing it fast, and both applications (console and yours) could hang. Believe me, this can be potentially a very big problem I used to get with the BlitzMax built in debuger. My Advise: Function PrintString(S:String, EndLine:Int = True) StandardIOStream.WriteString(S) If endLine Then StandardIOStream.WriteString("~n") StandardIOStream.Flush() End Function PrintString("Hello") PrintString("Your name is ", False) 'This will not end the current console line PrintString("Michael") Hope it helps |