Scripting: If Statements and Exit Script

steverichter
Mon, 07 Jun 2021 01:08:23 +0000
Lounge (Discussions)

I typically create scripts with the structure:

Enter Find Mode
Set Field
Set Field
Set Field
Perform Find
If Get Found Count > 0
Do Stuff
Else
Show Custom Dialog - No Results
End If
Exit Script

However, I’ve seen another structure:

Enter Find Mode
Set Field
Set Field
Set Field
Perform Find
If Get Found Count = 0
Show Custom Dialog - No Results
Exit Script
End If
Do Stuff
Exit Script

While I like the logic flow of the first method, the second may be easier to read. What is your preferred method?

9 posts - 7 participants