|
Posted by Bob Stearns on 07/27/06 22:45
Andy Hassle wrote:
> On Thu, 27 Jul 2006 18:14:02 -0400, Bob Stearns <rstearns1241@charter.net>
> wrote:
>
>
>>Andy Hassall wrote:
>>
>>>On Thu, 27 Jul 2006 17:47:50 -0400, Bob Stearns <rstearns1241@charter.net>
>>>wrote:
>>>
>>>>I have a variable v with the value -1. After v++ it has the value "" not
>>>>0. Since I am using it for a subscript, the "" value is not overwriting
>>>>the 0 element of the array as desired. Should v++ ever give a
>>>>non-numeric value?
>>>
>>> No - post a script and output demonstrating this?
>>>
>>> Since you're not on the latest release of a branch the standard advice would
>>>be "upgrade", though, if this actually happens.
>>>
>>
>>Here is a script fragment and the debugging output therefrom:
>
> [snip]
>
>>stk_ptr=; stack=array 2 { 0=>array 2 { 0=>13; 1=>; }
>>=>array 2 { 0=>11; 1=>; }
>>}
>>
>>As you can see, stk_ptr is "", and so when it is used as a subscript,
>>stack[0] is not overwritten, which hangs the whole script in an infinite
>>loop.
>
>
> Can you reduce this to a script that can be run stand-alone?
>
My error. Twice I mistyped the variable $stk_ptr; once as $stkptr and
once as $stack_ptr. The errors offset each other in such a way as to
lead me to the erroneous conclusion about ++.
Navigation:
[Reply to this message]
|