lookdown behavior
Archiver
Posts: 46,084
Hello,
if i have:
value var ind
value2 var value
ok..
lookdown value, (1,2,3..ect.)
will lookdown read InD just once? or will it read inD once for every
single value in the lookdown list? silly but i don't know.
if more than once (i don't want that)
value2 being an alias will not read InD will it?
Another thing I wonder about is will lookdown jump to branch as soon
as it finds it's "first match" or will continue lookdown to the end
of the list for no reason? Just asking because this will decide how i
code my program in some respects.
Thanks..that's it.
if i have:
value var ind
value2 var value
ok..
lookdown value, (1,2,3..ect.)
will lookdown read InD just once? or will it read inD once for every
single value in the lookdown list? silly but i don't know.
if more than once (i don't want that)
value2 being an alias will not read InD will it?
Another thing I wonder about is will lookdown jump to branch as soon
as it finds it's "first match" or will continue lookdown to the end
of the list for no reason? Just asking because this will decide how i
code my program in some respects.
Thanks..that's it.
Comments
writes:
> if i have:
> value var ind
> value2 var value
> ok..
>
> lookdown value, (1,2,3..ect.)
> will lookdown read InD just once? or will it read inD once for every
> single value in the lookdown list? silly but i don't know.
>
> if more than once (i don't want that)
> value2 being an alias will not read InD will it?
>
> Another thing I wonder about is will lookdown jump to branch as soon
> as it finds it's "first match" or will continue lookdown to the end
> of the list for no reason? Just asking because this will decide how i
>
The way you've written your program, whenever InD changes you will
automatically see changes in value and value2. This is because those
variables are not actually part of the program variable space. They are, in
fact, pointers to InD. If you check the memory map with the declarations you
have above, you'll see that there are no variables used.
If you want to read InD and preserve it, just define a simple NIB variable
and read it with an assignment (myNibVar = InD).
In your program, when the LOOKDOWN line is hit, the current value of InD will
be use (since value points to InD). As far as LOOKDOWN, if there is no match
found in the list, the output variable will not be affected.
-- Jon Williams
-- Parallax
[noparse][[/noparse]Non-text portions of this message have been removed]