The other differentiation that's important to make is that while you
can't "send" an empty string over a 232 or TCP* connection (unless you
have a delimiter defined and consider that to be "empty"), empty
strings can and do exist in memory.
[*]You** can send an empty TCP packet, but it functions identically to
an ACK/Keepalive and doesn't send any info up to the application
layer, as no data was transmitted -- TCP is byte-oriented.
[**]Meaning the TCP/IP stack, not from SIMPL or SIMPL+.
On Tue, Apr 3, 2012 at 9:59 AM, Jeremy Weatherford <jweather@...> wrote:
Crestron doesn't use (or at least doesn't expose) C-style strings,
though, otherwise it would be awkward to deal with device protocols
containing \x00. ?It's perfectly possible to have an empty string, and
easy to work with them in SIMPL+ (string = "" or len(string) = 0),
it's just a little trickier to deal with in SIMPL-land since it
doesn't "match" anything in an SIO.
On Tue, Apr 3, 2012 at 9:44 AM, rickmcneely <rickmcneely@...> wrote:
I don't know how you would search for nothing. ?Am I missing something? ?Probably.
A string is a string unless it is a string. ?A C style string is terminated with a \x00. ?If there is nothing before the \x00 then it is considered to be a zero-length string. ?Inserting a \x00 in the middle of a C string would be exactly the same as changing the length.
Some strings (like windows OLE strings or 'The OTHER control system' strings) are actually a structure containing a character array and a length, or some variation. ?In strings like that, the length of the string is determined by the length property, and not by some marker byte like \x00.
But usually, devices don't send either type of string. ?The control system just stores whatever is received in some type of string. ?Could be either of the above or some variation. ?Usually the controlled system delimits lines with some type of ETX and/or STX. ?Usually just the ETX and usually that is a carriage-return or carriage-return/line-feed. ?In that case, a line containing only the ETX would be considered empty.
------------------------------------
Check out the Files area for useful modules, documents, and drivers.
A contact list of Crestron dealers and programmers can be found in the Database area.
Yahoo! Groups Links
--
Jeremy Weatherford
--
Jeremy Weatherford