September 3, 200520 yr Hi gang, I am writing a script that uses the tab order to set the fields. I am trying to use the go to next field step but how do I exit a loop? I know I can manually count the number of fields in the layout and use a script variable, but is there an easier way? Thanks in advance
September 3, 200520 yr There are many ways to exit the script, so it depends on your decision criteria. You could use the field name as a trigger to exit. What is your script attempting to do ? I have used scripts extensively to perform my own validation routines, and have also used the tab sequence on occasions.
September 3, 200520 yr A genuine version 8 method is to store Get(ActiveFieldName) in a variable after initially Go To Field without focus followed by a Go To Next Field. This will bring you to the first field in the layout and putting it into a variable makes a reference for the looping, so all the sillyness we used to do with script recursions is now overkill. I hope sincerly that it's use, is to recreate a stored request, otherwise would it be a slight violation of the relational approach, having the same data in more than one place defeats the object of relational structure. --sd
September 3, 200520 yr Author Thanks guys, The script is to convert a number of nutrient values for a specified quantity. Each field is multiplied by the same calc amount. Get(active fieldname) works great. It's amazing how we forget, I have used it in the past and just got a brain block. I am using script variables instead of globals, yee ha for them. Thanks again
Create an account or sign in to comment