WriteProgramString(program, FLAG)

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

WriteProgramString(program, FLAG)

Post by srod »

Hi,

would it be possible to add a flag to the ReadProgramString() and WriteProgramString() functions to set the format of the strings being read from stdin or written to stdout etc? Much like PeekS(), PokeS() etc.

The reason I ask is that I am writing an app which needs to communicate with the PB compiler and when running in Unicode mode I have to take steps to send all commands in ascii and receive all data in ascii etc. When reading the output from the compiler, I have to use ReadProgramData() when running my app in unicode mode etc. It would be far easier to use ReadProgramString() with a #PB_Ascii flag etc.


(@Freak : I am finding that when using ReadProgramData() to get the compiler's output (STANDBY mode), unless I read one byte at a time, I am finding it difficult to get the compiler to send all the data, it doesn't seem to flush it's 'outbound' pipe until I close the connection with the compiler - something I can't do until the compiler has sent all of it's data! E.g. with a buffer of 1024 bytes, I typically find that 200+ bytes remain to be read - likely held up in a buffer somewhere! I can send you the code if you wish to take a look?)
I may look like a mule, but I'm not a complete ass.
lexvictory
Addict
Addict
Posts: 1027
Joined: Sun May 15, 2005 5:15 am
Location: Australia
Contact:

Post by lexvictory »

+1

Took me a while to realise that it was expecting a Unicode string.
Demonio Ardente

Currently managing Linux & OS X Tailbite
OS X TailBite now up to date with Windows!
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

This lib is due for an internal rework anyway, so this might be a good thing to add.
quidquid Latine dictum sit altum videtur
Post Reply