Jump to content

Exit After Last. Then What?

This topic is 4348 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi All. I have a layout where employees can go to print what we call Sets. The script goes to the Sets layout, loops through till it gets to the next set that has not been printd, stops there and prints the set. After printing it tags that set as printed on this date by said employee. That all works great. The problem I'm trying to figure out is what to do if all sets are printed and how to specify a dialog if the loop gets to last record and exits without finding a Set to print.

Here is my script.

Perform Script [ “User Abort” ]

Perform Script [ “Set Error Capture” ]

Set Variable [ $param; Value:Evaluate ( Get ( ScriptParameter )) ]

Go to Layout [ “Sets_Form” (Sets) ]

Enter Find Mode [ ]

Set Field [ Sets::_fk_job_id; $Job ]

Perform Find [ ]

Sort Records [ Specified Sort Order: Sets::set_number; ascending ]

[ Restore; No dialog ]

Go to Record/Request/Page

[ First ]


Exit Loop If [ Sets::set_type ≠ "Repeat" and Sets::set_type ≠ "Tap" and IsEmpty ( Sets::printed ) ]

Go to Record/Request/Page

[ Next; Exit after last ] <----- If it gets to this point and exits, I would like to have it do something else.

End Loop

Perform Script [ “Print Set” ]

Go to Layout [ original layout ]

Go to Object [ Object Name: $object ]

Any suggestions would be appreciated.


Link to comment
Share on other sites


What is the script parameter and why do you feel that you need to wrap it with Evaluate()?

Why not find for Sets that have your $job and Sets::Printed is empty (just set the field to "=" without the quotes)?

Then, if get(foundcount)=0, you can pop a dialog and stop right there.

Basically, why the loop?

Link to comment
Share on other sites

The evaluate part is a method of passing multiple predefined script parameters. Your suggestion makes a lot of sense. I'll rework it tomorrow. Seems like I had a spacific reason for the loop when I planned it, but it escapes me right now. Either way I'm pretty sure doing a find for unprinted makes better sense. If I run into any reason that it won't work I'll be back.


Link to comment
Share on other sites

This topic is 4348 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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.