LENGTH_ARRAY // LENGTH_STRING Question
Raphayo
Posts: 111
Hi All,
what is the difference between those command, why they didn't reply the same value.
the response i got is:
Line 1 & 4 return the correct answer but why the answer 2,3,5 & 6 are not the same has 1 & 4. It look the same for me. Thanks to help me understand this one.
what is the difference between those command, why they didn't reply the same value.
button_Event[dvtp,127] { push: { local_var char ctemp[5] ctemp='Stop:' send_string 0,"' LENGTH_ARRAY1: ',itoa(LENGTH_ARRAY(ctemp))" send_string 0,"' LENGTH_ARRAY2: ',itoa(LENGTH_ARRAY('Stop:'))" send_string 0,"' LENGTH_ARRAY3: ',itoa(LENGTH_ARRAY("'Stop:'"))" send_string 0,"' LENGTH_STRING1: ',itoa(LENGTH_STRING(ctemp))" send_string 0,"' LENGTH_STRING2: ',itoa(LENGTH_STRING('Stop:'))" send_string 0,"' LENGTH_STRING3: ',itoa(LENGTH_STRING("'Stop:'"))" } }
the response i got is:
Line 1 (06:38:28):: LENGTH_ARRAY1: 5 Line 2 (06:38:28):: LENGTH_ARRAY2: 1152244836 Line 3 (06:38:28):: LENGTH_ARRAY3: 1152244836 Line 4 (06:38:28):: LENGTH_STRING1: 5 Line 5 (06:38:28):: LENGTH_STRING2: 1152244836 Line 6 (06:38:28):: LENGTH_STRING3: 1152244836
Line 1 & 4 return the correct answer but why the answer 2,3,5 & 6 are not the same has 1 & 4. It look the same for me. Thanks to help me understand this one.
0
Comments
Perhaps someone knows the rules better, but when I run across something wonky like this, I just backpedal and find the method that gives the correct result and move on. With an interpreted language like Netlinx that has a limited application, sometimes that's the best you can do unless you were involved in writing the compiler.
Is the output I get with the following code:
I'm running it on a ni-3100 running 4.1.404.