Page 1 of 1

I need some advice

Posted: Thu Feb 20, 2025 5:16 am
by medarda
I'm working on a LiveCode project and running into a bug when trying to update a field dynamically. I have a button that, when clicked, should update `field "output"` with new text, but nothing happens. Here's my code inside the button:

Code: Select all

on mouseUp
   put "Hello, LiveCode!" into field "output"
end mouseUp
The field exists on the card, and its name matches exactly. However, the text doesn't update when I click the button.

I've tried refreshing the screen with `revRefreshWindow`, but that didn't help. Am I missing something? How can I fix this?

Re: I need some advice

Posted: Thu Feb 20, 2025 7:30 am
by FourthWorld
Open the Project Browser and double check that you don't have another field with the same name.

Re: I need some advice

Posted: Thu Feb 20, 2025 3:01 pm
by dunbarx
What Richard means is that your handler should work just fine, and therefore we have to look for other issues. Are you sure of the spelling of the name of field "output"? For example, sometimes an errant space can thwart the process, or perhaps you actually named it "field output", that sort of thing. But know that if either of those two conditions existed, LC would throw an error as opposed to simply appear to do nothing at all, since it essentially could not "find" that field.

Try this, make a new field on the card and name it something simple, like "XYZ". Run your handler with that. If it works, then we know that something is confusing LC about identifying field "output".

Craig

Re: I need some advice

Posted: Wed May 07, 2025 9:12 am
by dominantpredict
A simple debug line to see if the button works:

on mouseUp
answer "Button clicked"
put "Hello, LiveCode!" into field "output"
end mouseUp

If the warning does not appear, then the Script may not be attached to the button. Or the Script may be placed in the wrong handler or object.

Re: I need some advice

Posted: Wed May 07, 2025 2:44 pm
by dunbarx
I forgot about this thread. Bottom line, Medarda, did you fix the problem?

Craig

Re: I need some advice

Posted: Wed May 07, 2025 6:41 pm
by richmond62
Why do I think 'Medarda' was a one-post wonder?

Re: I need some advice

Posted: Sat May 31, 2025 9:41 am
by MiaVardy
medarda wrote:
Thu Feb 20, 2025 5:16 am
I'm working on a LiveCode project and running into a bug when trying to update a field dynamically. I have a button that, when clicked, should update `field "output"` with new text, but nothing happens. Here's my code inside the button:

Code: Select all

on mouseUp
   put "Hello, LiveCode!" into field "output"
end mouseUp
The field exists on the card, and its name matches exactly. However, the text doesn't update when I click the button.

I've tried refreshing the screen with `revRefreshWindow`, but that didn't help. Am I missing something? How can I fix this?
double-check that the field "output" is on the same card as the button and is visible. If it still doesn't update, try using the full reference: put "Hello, LiveCode!" into field "output" of this cd to ensure it’s targeting the correct object.

Re: I need some advice

Posted: Sat May 31, 2025 3:04 pm
by dunbarx
This does not feel like a bot.

Medarda?

Re: I need some advice

Posted: Sat May 31, 2025 6:39 pm
by richmond62
Personally I have never felt a bot . . . but then, who am I to speak about that: I confine myself to my wife, my cat, and my teddy bear. 8)

There seem to be quite a few of these "one hit wonders" which may well NOT be bots, simply people who, having downloaded a 10-day trail from LiveCode find they have run out of time before they get an answer which serves their purposes.

As LiveCode will NOT allow the same user to download a trial a second time I am sure that they are losing quite a few would-be takers because of this problem.