Anh_Tran Posted July 10, 2003 Posted July 10, 2003 Hi All,, I have a script to check 2 fields if they are empty then user goes to that field and fill data . My script is loop if isempty(field1) go to field1 ...endif if isempty(field2) go to field 2 ...endif exit loop if field1 <> "" and field2 <> "" end loop but it just run very fast ..does not pause for people to fill in and go to next fill to fill in ...Some people have an example or an idea about checking empty and go to that field to fill in?? Thanks Anh Tran
Razumovsky Posted July 10, 2003 Posted July 10, 2003 loop if isempty(field1) go to field1 show message "Please fill in field 1" pause/resume endif if isempty(field2) go to field 2 show message "Please fill in field 2" pause/resume endif exit loop if field1 <> "" and field2 <> "" end loop should work (show message is optional...) -Raz
Anh_Tran Posted July 10, 2003 Author Posted July 10, 2003 hello Raz, it works fine .. Do you know a way to check if the repeat field is empty or not ... is there a way to check the repeat field is empty or do i have to type repeat-1, repeat-2 and so on.... if the repeat field is 100 repetition ...this is long to check if one of them is not empty??? because one of them is not empty then it is fine. Anh Phu
Razumovsky Posted July 10, 2003 Posted July 10, 2003 Anh- That is one reason why many people advise strongly against using repeating fields unless absolutely neccessary. Unfortunately, I believe if your repeating field is 100 repetitions long, you will need at least 100 lines of script. Or perhaps a 100 line conditional if statement: If [is empty(getrepetition(YourField, 1) and is empty(getrepetition(YourField, 2) and is empty(getrepetition(YourField, 3) and...] Show message "You must enter data in at least one line" go to field [YourField] Pause/Resume End If I would suggest you consider creating an additional related "LineItems" file that would be displayed in a portal to replace your repeating field. Will probably make things much easier later on. -Raz
-Queue- Posted July 10, 2003 Posted July 10, 2003 I would modify Raz's steps a little bit for efficiency. Loop Exit Loop If[ not IsEmpty(GetRepetition(YourField, 1)) or not isempty(GetRepetition(YourField, 2))...] Show message "You must enter data in at least one line." Go to Field["YourField"] Pause/Resume Script End Loop The 'or's will allow the loop to terminate once one of the conditions has been met. The 'and's will require the If statement to check for all conditions before continuing. At least this is my understanding of it. Does anyone know for certain whether this is true? It seems logical, at least.
Razumovsky Posted July 10, 2003 Posted July 10, 2003 Theory sounds good, wonder what/if the difference in performance would be, allthough not quite curious enough to test it out...
Anh_Tran Posted July 10, 2003 Author Posted July 10, 2003 With my knowledge it would be the same ... Filemaker has some limitations ...about speed ...caluculation field ...summary field ...i wait forever Thanks Guys Anh Phu
-Queue- Posted July 10, 2003 Posted July 10, 2003 I just tested this with a repeating field (25 repetitions). Both performed in less than a second. Guess we need to find someone who's really bored and have them test 100 for us.
Anh_Tran Posted July 10, 2003 Author Posted July 10, 2003 I mean that the script runs fast ...but for example , if you have like 100 000 records and u have calculation field as summary...total ....then you will hire someone to test how long does it take for you ....
-Queue- Posted July 10, 2003 Posted July 10, 2003 It depends how complicated the field is you're summarizing. Number fields go relatively quickly, whereas calcs of calcs of calcs......oi vey!
Recommended Posts
This topic is 7810 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now