clear content in fields

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
bsouthuk
Posts: 261
Joined: Fri Dec 05, 2008 7:25 pm

clear content in fields

Post by bsouthuk » Tue Jan 26, 2010 5:58 pm

Hi

Wonder if somebody can help...

I have a button on a stack that when its pressed it deletes all content in certain fields. There are around 60 fields that I need content deleted when the button is pressed and at the moment I have the simple put "" into field "field" for each field.

Is there a way I can code the button so it puts "" into all fields within a group so its quicker and easier for me to maintain?

Cheers

Daniel

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

Re: clear content in fields

Post by Klaus » Tue Jan 26, 2010 6:24 pm

Hi Daniel,

you can loop through the fields like this:

Code: Select all

...
put the num of flds of grp "Your group here" into num_fields
lock screen
repeat with i = 1 to num_fields
   put empty into fld i of grp "Your group here"
end repeat
unlock screen
...
Best

Klaus

bsouthuk
Posts: 261
Joined: Fri Dec 05, 2008 7:25 pm

Re: clear content in fields

Post by bsouthuk » Tue Jan 26, 2010 6:29 pm

Excellent - thank you very much.

Daniel

Post Reply