fields changed ?

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
link76
Posts: 99
Joined: Fri Nov 04, 2011 1:52 pm

fields changed ?

Post by link76 » Mon Jan 13, 2014 1:55 pm

Hello,
I have a card with many fields and Option menu, I would like to check if they are changed on the close card. :roll: ??

Code: Select all

on closeCard
..... check changed field .....
end closeCard

thank you 


Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: fields changed ?

Post by Klaus » Mon Jan 13, 2014 2:04 pm

Hi,

this obviously requires that you store the content of all your fields "on opencard" for later comparison!
So I would rather "trap" the "closefield" handler(s) of your fields.


Best

Klaus

link76
Posts: 99
Joined: Fri Nov 04, 2011 1:52 pm

Re: fields changed ?

Post by link76 » Mon Jan 13, 2014 2:39 pm

Klaus wrote:Hi,

this obviously requires that you store the content of all your fields "on opencard" for later comparison!
So I would rather "trap" the "closefield" handler(s) of your fields.


Best

Klaus
thank you!
how can I read all fileds on open card?

Code: Select all

put field "text1" into tFld1
put field "text2" into tFld2
put field "text3" into tFld3
a fast method?

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: fields changed ?

Post by Klaus » Mon Jan 13, 2014 2:48 pm

As long as you do not have > 100 fields on a card, every method to collect the data should be fast enough! :D

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: fields changed ?

Post by jacque » Mon Jan 13, 2014 7:25 pm

If you only want to know if the fields have changed, but you don't care what the actual text changes are, then I like Klaus' first idea best. Just set a variable (global, or script local) on closeField. Then all you need to do on closeCard is check the variable and see what it contains.

If you do need to know the actual changed text then yes, you'd need to do it the second way and scan all the fields.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply