Page 1 of 1

delete all field

Posted: Thu Aug 20, 2015 9:31 am
by link76
Hello,
I would like to delete all field that contain the word "ora" in the name,

Code: Select all

repeat for the number of field in this card
      if the name of fld contains "ora" then
        delete fld ...
      end if
   end repeat
thanks

Re: delete all field

Posted: Thu Aug 20, 2015 10:52 am
by bn
Hi Link76,

try

Code: Select all

on mouseUp
   repeat with i = the number of fields down to 1
      if the short name of field i contains "ora" then delete field i
   end repeat
end mouseUp
note that you have to go down with your repeat counter because deleting a control will change the number of controls and you will try to delete a control that does not exist by that number anymore. Best to try it on a small example stack to see what happens.

Oh, and if you want to delete many fields you might want to lock screen and lock messages too.

Kind regards

Bernd

Re: delete all field

Posted: Thu Aug 20, 2015 11:01 am
by link76
thanks ! :wink: