On Apr 5, 2007, at 1:51 AM, Marc Zeedar wrote:

>
> On Apr 5, 2007, at 12:27 AM, Octave Julien wrote:
>
>> I'm going to put my ego aside and ask a very basic question.
>>
>>      dim originalValue as integer
>>      originalValue = ubound(someArray)
>>
>>      dim i as integer
>>      i=original value
>>      do until i = -1
>>              [do some stuff]
>>              i=i-1
>>      loop
>>
>> ...originalValue is decreased in the same time, which is a problem in
>> my situation, because I can't get the original value again after the
>> loop.
>
> What makes you think originalValue is decreased? It shouldn't -- when
> you write "i = originalValue" that's copying the actual value, not a
> reference to an object. I copied your code into a PushButton and
> added a "msg str(originalValue)" at the end and it showed me the
> proper uBound(someArray) value just fine. I think perhaps the code
> you're having trouble with is different than this simple example and
> has a different bug in it.

If the above code actually compiled, I would be amazed. Actually  
Octave mentioned the error (sort of) as well.

> The compiler also stops and says :
>       This method or property does not exist.
>       i=originalValue


"i=original value" is *not* "i=originalValue" which would compile.  
When I tried his code, I simply pasted it and the error message I got  
was

This method or property does not exist.
i=original value

with original highlighted.

If you then add "original" to the dim statement it will then report  
"value" as not existing.

Did Octave copy and paste the code or just retype?

Fixing the actual variable address, setting originalValue to an  
actual number [5] (which shouldn't matter anyway), commenting out [do  
some stuff] and running the code results in i=-1 and originalValue=5.

The only thing that might affect OriginalValue's value might be in  
the [do some stuff] code?

Terry

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to