Update fields without user interaction

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
kolia
Posts: 82
Joined: Thu May 28, 2015 3:53 pm

Update fields without user interaction

Post by kolia » Tue Sep 08, 2015 4:55 pm

Hello,
I want to update some data fields without user interaction, which means there is a need for some kind of process running aside being able to grab data and update fields or any other objects. Is there a way to do that?
Thank you
Nicolas
LC 7.1 on Windows 8.1 and on MAC OS 10.10.5 Xcode 6.4 - 7.1

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

Re: Update fields without user interaction

Post by dunbarx » Tue Sep 08, 2015 5:05 pm

Hi.

It may matter greatly how this new data is acquired. But in the meantime, on a new card, make a field and a button. In the button script:

Code: Select all

on mouseUp
   runFieldUpdater
end mouseUp

on runFieldUpdater
   if the optionkey is down then exit runFieldUpdater
   put the mouseLoc into fld 1 --this could be anything at all
   send "runFieldUpdater" to me in 30
end runFieldUpdater
If you click the button and move the mouse around, you will see the mouseLoc appear in the field every half second. You can escape by holding the optionKey down for just a little while. But is this what you meant by:
update some data fields without user interaction,
Anyway, the process runs in the "background" and is not blocking.

Craig Newman

kolia
Posts: 82
Joined: Thu May 28, 2015 3:53 pm

Re: Update fields without user interaction

Post by kolia » Tue Sep 08, 2015 5:08 pm

Hi Craig,
Thanks for the code snippet. Yes you're right I should have said how data is acquired. In this case, data is acquired by executing a put URL and then parsing the XML response
Nicolas
Nicolas
LC 7.1 on Windows 8.1 and on MAC OS 10.10.5 Xcode 6.4 - 7.1

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

Re: Update fields without user interaction

Post by dunbarx » Tue Sep 08, 2015 7:07 pm

OK.

So does the snippet I give you enough ammunition to proceed with your project?

Craig

kolia
Posts: 82
Joined: Thu May 28, 2015 3:53 pm

Re: Update fields without user interaction

Post by kolia » Tue Sep 08, 2015 7:21 pm

So far yes. I'll write back if I face difficulties.
Thanks again
Nicolas
Nicolas
LC 7.1 on Windows 8.1 and on MAC OS 10.10.5 Xcode 6.4 - 7.1

Post Reply