Odd Name Resolution

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Odd Name Resolution

dunbarx via use-livecode
Hi all.

I have noticed that if I reference an object on a different card while that card is not the current card, I have to use the full path to that object. For instance:

put the hilited of button "btndbprimary" of card "Database Setup"

this will return true if card "Database Setup" is the current card, but will return false if it is not, even though the button is hilited.

However,

put the hilited of button "btndbprimary" of card "Database Setup" of stack "Forms Generator"

WILL return true no matter where I use it. Is this normal behavior?

Bob S


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Odd Name Resolution

dunbarx via use-livecode
if you don't specify the stack it uses the "defaultstack" ... so is it
returning false even if the button is not there?

On Tue, Apr 3, 2018 at 3:59 PM, Bob Sneidar via use-livecode <
[hidden email]> wrote:

> Hi all.
>
> I have noticed that if I reference an object on a different card while
> that card is not the current card, I have to use the full path to that
> object. For instance:
>
> put the hilited of button "btndbprimary" of card "Database Setup"
>
> this will return true if card "Database Setup" is the current card, but
> will return false if it is not, even though the button is hilited.
>
> However,
>
> put the hilited of button "btndbprimary" of card "Database Setup" of stack
> "Forms Generator"
>
> WILL return true no matter where I use it. Is this normal behavior?
>
> Bob S
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Odd Name Resolution

dunbarx via use-livecode
The button is there. It returns false. The checkbox is checked. As I said it works if the card is the currentCard. The only stack open at the time IS the Forms Generator stack, so it has to be the defaultStack.

Bob S


> On Apr 3, 2018, at 13:12 , Tom Glod via use-livecode <[hidden email]> wrote:
>
> if you don't specify the stack it uses the "defaultstack" ... so is it
> returning false even if the button is not there?


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Odd Name Resolution

dunbarx via use-livecode
hmmm....thats really weird ...... maybe one of the IDE stacks is being
considered as the defaultstack.... i don't know why else the ref would not
work....

it really is weird.... you should report it....can you post a stack?

On Tue, Apr 3, 2018 at 6:24 PM, Bob Sneidar via use-livecode <
[hidden email]> wrote:

> The button is there. It returns false. The checkbox is checked. As I said
> it works if the card is the currentCard. The only stack open at the time IS
> the Forms Generator stack, so it has to be the defaultStack.
>
> Bob S
>
>
> > On Apr 3, 2018, at 13:12 , Tom Glod via use-livecode <
> [hidden email]> wrote:
> >
> > if you don't specify the stack it uses the "defaultstack" ... so is it
> > returning false even if the button is not there?
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Odd Name Resolution

dunbarx via use-livecode
I will try to throw one together. Note that it isn't returning an error, which it would if the defaultStack was something else, and the button or card did not exist. It's not doing that. It's returning a false value.

Bob S


> On Apr 3, 2018, at 15:32 , Tom Glod via use-livecode <[hidden email]> wrote:
>
> hmmm....thats really weird ...... maybe one of the IDE stacks is being
> considered as the defaultstack.... i don't know why else the ref would not
> work....
>
> it really is weird.... you should report it....can you post a stack?


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Odd Name Resolution

dunbarx via use-livecode
Bob,

This works for me when I’m on the card with the button:
put "btn: Set10to15" && the hilited of button "Set10to15"


This works for me on any card in the stack:
put "btn: Set10to15" && the hilited of button "Set10to15" of cd "GameCardHD"


The button I’m referencing is in a group on the cd "GameCardHD"

Any chance you have two buttons with the same name on the card? Perhaps same name, but in different groups? I ask, because I seen similar results as you describe when I’ve done both of those things.

be well,
randy

Randy Hengst
www.classroomFocusedSoftware.com


> On Apr 3, 2018, at 5:38 PM, Bob Sneidar via use-livecode <[hidden email]> wrote:
>
> I will try to throw one together. Note that it isn't returning an error, which it would if the defaultStack was something else, and the button or card did not exist. It's not doing that. It's returning a false value.
>
> Bob S
>
>
>> On Apr 3, 2018, at 15:32 , Tom Glod via use-livecode <[hidden email]> wrote:
>>
>> hmmm....thats really weird ...... maybe one of the IDE stacks is being
>> considered as the defaultstack.... i don't know why else the ref would not
>> work....
>>
>> it really is weird.... you should report it....can you post a stack?
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Odd Name Resolution

dunbarx via use-livecode
That might be possible except I've checked for that already, and also it doesn't fit the symptoms I've already expressed. The phrase evaluates correctly if the target card is the currentcard, or if I reference the object using the full name. It only fails (actually it returns bad value) if I reference it up to the card name and that card is not the top stack.

For me this is moot since I have gotten into the habit now of referencing objects using their long IDs to dispel all doubt, and to avoid other naming conflicts, like similar cards with objects with the same names. I like having apps with multiple windows, and given that, full references is definitely the way to go.

Bob S


> On Apr 4, 2018, at 05:39 , Randy Hengst via use-livecode <[hidden email]> wrote:
>
> Bob,
>
> This works for me when I’m on the card with the button:
> put "btn: Set10to15" && the hilited of button "Set10to15"
>
>
> This works for me on any card in the stack:
> put "btn: Set10to15" && the hilited of button "Set10to15" of cd "GameCardHD"
>
>
> The button I’m referencing is in a group on the cd "GameCardHD"
>
> Any chance you have two buttons with the same name on the card? Perhaps same name, but in different groups? I ask, because I seen similar results as you describe when I’ve done both of those things.
>
> be well,
> randy
>
> Randy Hengst

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode