I need some advice

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
medarda
Posts: 1
Joined: Thu Feb 20, 2025 5:10 am
Contact:

I need some advice

Post by medarda » 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?

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10044
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: I need some advice

Post by FourthWorld » Thu Feb 20, 2025 7:30 am

Open the Project Browser and double check that you don't have another field with the same name.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10315
Joined: Wed May 06, 2009 2:28 pm

Re: I need some advice

Post by dunbarx » Thu Feb 20, 2025 3:01 pm

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

dominantpredict
Posts: 1
Joined: Wed May 07, 2025 9:05 am
Contact:

Re: I need some advice

Post by dominantpredict » Wed May 07, 2025 9:12 am

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.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10315
Joined: Wed May 06, 2009 2:28 pm

Re: I need some advice

Post by dunbarx » Wed May 07, 2025 2:44 pm

I forgot about this thread. Bottom line, Medarda, did you fix the problem?

Craig

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10094
Joined: Fri Feb 19, 2010 10:17 am

Re: I need some advice

Post by richmond62 » Wed May 07, 2025 6:41 pm

Why do I think 'Medarda' was a one-post wonder?

MiaVardy
Posts: 1
Joined: Sat Sep 28, 2024 7:53 am
Contact:

Re: I need some advice

Post by MiaVardy » Sat May 31, 2025 9:41 am

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.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10315
Joined: Wed May 06, 2009 2:28 pm

Re: I need some advice

Post by dunbarx » Sat May 31, 2025 3:04 pm

This does not feel like a bot.

Medarda?

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10094
Joined: Fri Feb 19, 2010 10:17 am

Re: I need some advice

Post by richmond62 » Sat May 31, 2025 6:39 pm

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.

Post Reply