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.

> After reading the manual, I thought that writing...
>
>       const originalValue= ubound(someArray)

No, that doesn't work because you can't use a function as part of the  
const declaration. Just like you can't say "const tab = chr 
(9)" (which would be nice).


> If, for a try, I write...
>       
>       const originalValue=3
>
> The compiler also stops and says :
>       This method or property does not exist.
>       i=originalValue

I've no idea what's wrong with this. Looks fine to me. Are you not  
defining i or perhaps defining originalValue twice?



Marc Zeedar
Publisher, REALbasic Developer magazine
www.rbdeveloper.com


_______________________________________________
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