Re: Append a hex value to an AnsiString - TYPO

2005-02-17 07:27:49 PM
My Typo, see below for the correct code
Ok, thanks for the help so far. How can I perform the following?

#define STX '\x02'
#define ADDR '\x45'

txBuf->Write(STX ADDR, 2);

This is not valid. I am wanting too just write those two bytes into the
stream. If I #define them in double quotes (") then it works, but I have
them in single quotes as later in the file I do the following on some
recieved data:

case STX:
// blah blah
// more cases

If I have the #define's in double quotes then the switch-case statement
doesn't work.

Any suggestions?


Phil V

"Phil V" < XXXX@XXXXX.COM >wrote in message
news: XXXX@XXXXX.COM ...
>Thank you Remy!
>That was what I was looking for, once I could inspect the contents of the
>TMemoryStream it was obvious that I had tried to put \0x45 into the
>stream rather than \x45.
>Thanks again,
>Phil V
>"Remy Lebeau (TeamB)" < XXXX@XXXXX.COM >wrote in message
>news:4213a88d$ XXXX@XXXXX.COM ...
>>"Phil V" < XXXX@XXXXX.COM >wrote in message
>>news:42139367$ XXXX@XXXXX.COM ...
>>>I know, I wasn't asking for a solution to my problem here, I
>>>was just asking if there was a way to look at the data that a
>>>TMemoryStream contained via the watch window.
>>TMemoryStream is dynamically-sized, and watches need to have the data
>>specified. I tried to view a TMemoryStream in the Watch window, and it
>>complaining that the Repeat count was invalid even though it really
>>You can, however, view the stream in a debug Inspector instead. Just
>>the stream's Memory property and then cast it to unsigned char* since it
>>declared as void*. Also, set the range of the Inspector to be the
>>Size of the stream.
>>>I wrote the code as per here and that worked fine, then I tried
>>>to expand upon it, and now it does not work.
>>Please elaborate.