re: clear fields -- a faster way
I wrote >repeat for each line theFieldToBeCleared in the cAllFields of this cd > put empty into fld theFieldToBeCleared >end repeat Typo alert! needs to read put empty into fld ID theFieldToBeCleared ___ use-revolution mailing list use-revolution@lists.runrev.com http://lists.runrev.com/mailman/listinfo/use-revolution
Re: clear fields -- a faster way
Hi Bill, >I want to clear fields like this: >repeat for each field tField in card "DocApplication" of stack >"CustomForms" > put empty into tField >end repeat >but I keep getting the error "bad terminator" -- what am I doing wrong? As written before repeat for each does only work for chunk expressions. It also only makes sense if you got *really* many fields (100+) If you urgently want to use repeat for each you can store the ID of all fields to be cleared in a custom property, each ID on a line in the cProp and do it this way: repeat for each line theFieldToBeCleared in the cAllFields of this cd put empty into fld theFieldToBeCleared end repeat Cheers, Malte ___ use-revolution mailing list use-revolution@lists.runrev.com http://lists.runrev.com/mailman/listinfo/use-revolution
Re: clear fields -- a faster way
Hi Bill, I want to clear fields like this: repeat for each field tField in card "DocApplication" of stack "CustomForms" put empty into tField end repeat but I keep getting the error "bad terminator" -- what am I doing wrong? sorry, but "repeat for each..." will only work with chunk expressions. You will hve to use good ol': repeat with i = 1 to the num of flds of cd "DocApplication" of stack "CustomForms" put emtpy into fld i of cd "DocApplication" of stack "CustomForms" end repeat Hope that helps... Regards Klaus Major [EMAIL PROTECTED] http://www.major-k.de ___ use-revolution mailing list use-revolution@lists.runrev.com http://lists.runrev.com/mailman/listinfo/use-revolution
Re: clear fields -- a faster way
I want to clear fields like this: repeat for each field tField in card "DocApplication" of stack "CustomForms" put empty into tField end repeat but I keep getting the error "bad terminator" -- what am I doing wrong? Sarah Reichelt wrote: on mouseUp repeat with x = 1 to the number of flds put empty into fld x end repeat end mouseUp Now this works ok except that the card has some labels and the script clears the label contents. I use this sort of script which only clears editable fields. on mouseUp repeat with x = 1 to the number of flds if the lockText of fld x is false then put empty into fld x end repeat end mouseUp Sarah ___ use-revolution mailing list use-revolution@lists.runrev.com http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com http://lists.runrev.com/mailman/listinfo/use-revolution
Re: clear fields
on mouseUp repeat with x = 1 to the number of flds put empty into fld x end repeat end mouseUp Now this works ok except that the card has some labels and the script clears the label contents. I use this sort of script which only clears editable fields. on mouseUp repeat with x = 1 to the number of flds if the lockText of fld x is false then put empty into fld x end repeat end mouseUp Sarah ___ use-revolution mailing list use-revolution@lists.runrev.com http://lists.runrev.com/mailman/listinfo/use-revolution
Re: clear fields
Bob- Friday, June 3, 2005, 10:40:06 AM, you wrote: BH> All the text fields are called field1, field2 etc I name all my label fields with a "lbl" prefix, so in your example: lblField1, lblField2, etc then: BH> on mouseUp BH> repeat with x = 1 to the number of flds if char 1 to 3 of the name of fld x is not "lbl" then BH>put empty into fld x end if BH> end repeat BH> end mouseUp ...one of the joys of naming conventions... -- -Mark Wieder [EMAIL PROTECTED] ___ use-revolution mailing list use-revolution@lists.runrev.com http://lists.runrev.com/mailman/listinfo/use-revolution
Re: clear fields
On 6/3/05 11:02 AM, "Bob Hartley" <[EMAIL PROTECTED]> wrote: > Then I thought that since the field is number x and the fields are field1, > field2 etc then > on mouseUp > repeat with x = 1 to the number of flds > if the name of fld x is "field" & "x" >then put empty into fld x > end repeat > end mouseUp > > No luck there > > bob > You do not want the literal "x", so use the following if the name of fld x is ("field" & x) --without the quotes and preferentially the parens Jim Ault Las Vegas ___ use-revolution mailing list use-revolution@lists.runrev.com http://lists.runrev.com/mailman/listinfo/use-revolution
Re: clear fields
Hi Bob, looks like i misunderstood that i misunderstood you :-D Hi Bob, You wrote: Hi All I have a script that clears the contents of fields in cards. on mouseUp repeat with x = 1 to the number of flds put empty into fld x end repeat end mouseUp Now this works ok except that the card has some labels and the script clears the label contents. All the text fields are called field1, field2 etc so I thought of doing this on mouseUp repeat with x = 1 to the number of flds if the name of fld x is "field &*" then put empty into fld x end repeat end mouseUp But I don't ge tthe fields clearing. I tried variations on the "field & *" Then I thought that since the field is number x and the fields are field1, field2 etc then on mouseUp repeat with x = 1 to the number of flds if the name of fld x is "field" & "x" then put empty into fld x end repeat end mouseUp sorry, i misunderstood you. See above :-D You need brackets :-) on mouseUp repeat with x = 1 to the number of flds if the name of fld x = ("field" & "x") then put empty into fld x end if end repeat end mouseUp No luck there This will work, since the string will be evaluated first and without the brackets the engine will only look for a field -> "field", but with the brackets it will evaluate the string first to -> "field1" etc... in the loop. Brackets are necessary most of the time when it comes to strings! :-) bob Regards Klaus Major [EMAIL PROTECTED] http://www.major-k.de ___ use-revolution mailing list use-revolution@lists.runrev.com http://lists.runrev.com/mailman/listinfo/use-revolution
Re: clear fields
Hi Bob, You wrote: Hi All I have a script that clears the contents of fields in cards. on mouseUp repeat with x = 1 to the number of flds put empty into fld x end repeat end mouseUp Now this works ok except that the card has some labels and the script clears the label contents. All the text fields are called field1, field2 etc so I thought of doing this on mouseUp repeat with x = 1 to the number of flds if the name of fld x is "field &*" then put empty into fld x end repeat end mouseUp But I don't ge tthe fields clearing. I tried variations on the "field & *" Then I thought that since the field is number x and the fields are field1, field2 etc then on mouseUp repeat with x = 1 to the number of flds if the name of fld x is "field" & "x" then put empty into fld x end repeat end mouseUp sorry, i misunderstood you. You need brackets :-) on mouseUp repeat with x = 1 to the number of flds if the name of fld x = ("field" & "x") then put empty into fld x end if end repeat end mouseUp No luck there This will work, since the string will be evaluated first and without the brackets the engine will only look for a field -> "field", but with the brackets it will evaluate the string first to -> "field1" etc... in the loop. Brackets are necessary most of the time when it comes to strings! :-) bob Best Klaus Major [EMAIL PROTECTED] http://www.major-k.de ___ use-revolution mailing list use-revolution@lists.runrev.com http://lists.runrev.com/mailman/listinfo/use-revolution
Re: clear fields
You wrote: > Hi Bob, > Hi Klaus > But you could use: > > on mouseUp >repeat with x = 1 to the number of flds > if the short name of fld x CONTAINS "field" then > put empty into fld x > end if >end repeat > end mouseUp > > Hope that helps... Helps?? Absolutely brilliant the short name is one to remember. Thanks again. Cheers Bob > > > Cheers Bob > > Best > > Klaus Major [EMAIL PROTECTED] http://www.major-k.de > > ___ use-revolution mailing > list use-revolution@lists.runrev.com > http://lists.runrev.com/mailman/listinfo/use-revolution > ___ use-revolution mailing list use-revolution@lists.runrev.com http://lists.runrev.com/mailman/listinfo/use-revolution
Re: clear fields
You wrote: > Hi All > > I have a script that clears the contents of fields in cards. > > on mouseUp > repeat with x = 1 to the number of flds >put empty into fld x > end repeat end mouseUp > > Now this works ok except that the card has some labels and the script > clears the label contents. > > All the text fields are called field1, field2 etc > > so I thought of doing this on mouseUp > repeat with x = 1 to the number of flds > if the name of fld x is "field &*" > then put empty into fld x > end repeat end mouseUp > > But I don't ge tthe fields clearing. I tried variations on the "field & *" Then I thought that since the field is number x and the fields are field1, field2 etc then on mouseUp repeat with x = 1 to the number of flds if the name of fld x is "field" & "x" then put empty into fld x end repeat end mouseUp No luck there bob > etc without any luck. > > Any ideas > > Cheers Bob ___ use-revolution > mailing list use-revolution@lists.runrev.com > http://lists.runrev.com/mailman/listinfo/use-revolution > ___ use-revolution mailing list use-revolution@lists.runrev.com http://lists.runrev.com/mailman/listinfo/use-revolution
Re: clear fields
Hi Bob, Hi All I have a script that clears the contents of fields in cards. on mouseUp repeat with x = 1 to the number of flds put empty into fld x end repeat end mouseUp Now this works ok except that the card has some labels and the script clears the label contents. All the text fields are called field1, field2 etc so I thought of doing this on mouseUp repeat with x = 1 to the number of flds if the name of fld x is "field &*" then put empty into fld x end repeat end mouseUp But I don't ge tthe fields clearing. I tried variations on the "field & *" etc without any luck. sorry, but "*", if used as a wildcard, only works with "filter" and regex... Any ideas But you could use: on mouseUp repeat with x = 1 to the number of flds if the short name of fld x CONTAINS "field" then put empty into fld x end if end repeat end mouseUp Hope that helps... Cheers Bob Best Klaus Major [EMAIL PROTECTED] http://www.major-k.de ___ use-revolution mailing list use-revolution@lists.runrev.com http://lists.runrev.com/mailman/listinfo/use-revolution
clear fields
Hi All I have a script that clears the contents of fields in cards. on mouseUp repeat with x = 1 to the number of flds put empty into fld x end repeat end mouseUp Now this works ok except that the card has some labels and the script clears the label contents. All the text fields are called field1, field2 etc so I thought of doing this on mouseUp repeat with x = 1 to the number of flds if the name of fld x is "field &*" then put empty into fld x end repeat end mouseUp But I don't ge tthe fields clearing. I tried variations on the "field & *" etc without any luck. Any ideas Cheers Bob ___ use-revolution mailing list use-revolution@lists.runrev.com http://lists.runrev.com/mailman/listinfo/use-revolution