03-13-2019 06:21 AM
Dear Community,
please have a look at the attached code.
For the specified inputs n1=20 and n2=21 I need the string output indicator to be:
020D140D150D (hex display)
instead i get
020D31340D31350D.
How can I achieve that?
Thanks in advance
Solved! Go to Solution.
03-13-2019 06:55 AM
03-13-2019 07:08 AM - edited 03-13-2019 07:09 AM
Personally, I like to use Replace Array Subset to build up these types of commands.
03-13-2019 07:28 AM
Everyone has their favorite methods -- I prefer Format into String (right-click and look at Edit Format String and "adjust as needed").
Brief explanation: \\ means a single backslash (backslash has a special meaning, so \n is NewLine), %x means "number as hex", and ordinary characters mean themselves.
I have to say I don't understand why the original formulation didn't work (it wasn't something you did, as it didn't work for me, either ...).
Bob Schor
03-13-2019 08:14 AM
@Bob_Schor wrote:
Everyone has their favorite methods -- I prefer Format into String (right-click and look at Edit Format String and "adjust as needed").
That code does not produce the desired outcome. He wants the byte data, not the ASCII string.
I have to say I don't understand why the original formulation didn't work (it wasn't something you did, as it didn't work for me, either ...).
Bob Schor
I don't understand. Of course it doesn't work. The number is converted to a string. Maybe you didn't notice his output string indicator is set to hex display.
03-13-2019 08:54 AM
@thols wrote:
@Bob_Schor wrote:
Everyone has their favorite methods -- I prefer Format into String (right-click and look at Edit Format String and "adjust as needed").
That code does not produce the desired outcome. He wants the byte data, not the ASCII string.
I have to say I don't understand why the original formulation didn't work (it wasn't something you did, as it didn't work for me, either ...).
Bob Schor
I don't understand. Of course it doesn't work. The number is converted to a string. Maybe you didn't notice his output string indicator is set to hex display.
Right -- I missed that detail ...
BS
03-13-2019 09:00 AM
yep, that's right what I need.
Thanks.