Of course you can use this in a less object oriented way. :PI was thinking about that. I remember Turbo Professional had implemented that functionality with a custom TextRec.
Of course you can use this in a less object oriented way. :PI was thinking about that. I remember Turbo Professional had implemented that functionality with a custom TextRec.
ETA: Found it! It is System.WriteStr (https://freepascal.org/docs-html/current/rtl/system/writestr.html) and it behaves like Write(), not WriteLn(), though that shouldn't be too much of a problem.
There is also the counterpart: ReadStr()
ETA: Found it! It is System.WriteStr (https://freepascal.org/docs-html/current/rtl/system/writestr.html) and it behaves like Write(), not WriteLn(), though that shouldn't be too much of a problem.
There is also the counterpart: ReadStr()
Thanks for that. So WriteStr() and ReadStr() are presumably "magic" functions which rely on the compiler to parse a variable number of parameters without having to put them in (square) brackets.
Thank you everyone. This is good stuff. WriteStr, or using a stream, can do the trick. :)
Hey, @440bx, how would you be able to leverage WriteStr to write to a preallocated block of memory?I don't believe WriteStr can be made to write to a preallocated block of memory but, the output of WriteStr can be copied to a preallocated block of memory. It's a bit pedestrian but, ultimately with a little help, it does the trick.
Hey, @440bx, how would you be able to leverage WriteStr to write to a preallocated block of memory?I don't believe WriteStr can be made to write to a preallocated block of memory but, the output of WriteStr can be copied to a preallocated block of memory. It's a bit pedestrian but, ultimately with a little help, it does the trick.
Ah, okay. Thanks for clarifying. I was seriously wondering how that would work. :)You're welcome.