03-28-2009 01:44 AM
I have a text string control that I use to enter text and then when I press the <Enter> the text is sent out an RS232 comm port.
Is there a way to sent each character immediately after it is entered into the text window instead of waiting for the <Enter> key?
I want to emulate an RS232 comm port.
For example if I enter abcdf\befg
it would do the following:
ComWrt (comPort, buf, 1); // Where buf = "a"; ComWrt (comPort, buf, 1); // Where buf = "b";
ComWrt (comPort, buf, 1); // Where buf = "c"; ComWrt (comPort, buf, 1); // Where buf = "d"; ComWrt (comPort, buf, 1); // Where buf = "f"; ComWrt (comPort, buf, 1); // Where buf = "\b"; ComWrt (comPort, buf, 1); // Where buf = "e"; ComWrt (comPort, buf, 1); // Where buf = "f";
ComWrt (comPort, buf, 1); // Where buf = "g";
When there is more than one character I might have to read the string GetCtrlVal (gPanelHandle, PANEL_TX_STRING, buf) and only send the last one?
Thanks for any help.
03-28-2009 01:46 AM
This is more readable.
ComWrt (comPort, buf, 1); // Where buf = "a"
ComWrt (comPort, buf, 1); // Where buf = "b"ComWrt (comPort, buf, 1); // Where buf = "c"
ComWrt (comPort, buf, 1); // Where buf = "d"
ComWrt (comPort, buf, 1); // Where buf = "f"
ComWrt (comPort, buf, 1); // Where buf = "\b"
ComWrt (comPort, buf, 1); // Where buf = "e"
ComWrt (comPort, buf, 1); // Where buf = "f"ComWrt (comPort, buf, 1); // Where buf = "g"
03-28-2009 08:50 AM
03-28-2009 09:55 AM
Yes I am using it now. I just wanted to make sure that I was implementing this in the correct way. Sometimes the obvious isn't necessarily the most appropriate.
Confirmation always helps.
Thanks.