dbTalk Databases Forums  

Script step.... Exit IF

comp.databases.filemaker comp.databases.filemaker


Discuss Script step.... Exit IF in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Bizouman
 
Posts: n/a

Default Script step.... Exit IF - 04-25-2010 , 09:36 AM






Hi

I'm wondering if there's something I'm missing with managing script
step sequence.

I would like to have a script with multiple IF run after another
bacause they all need to be apply on a ExitField trigger.

IF#1 ....
Custom Dialog
IF YES
Do that
Else IF CANCEL
Exit Script
END IF
END IF#1
IF#2
do this
Else
Do that
EndIF#2

In that case after the 1st IF and the dialog if user select Cancel, it
will exit the current script and won't go the the 2nd IF and so on.

I found to way to deal with that.
Make One large script that run all the IF as sub-script (I don't like
it, because it make many script for nothing)

Anther way is to use the
LOOP
IF#1 ....
Custom Dialog
IF YES
Do that
Else IF CANCEL
Exit Loop
END IF
END IF#1
EXIT LOOP IF 1=1 ( this way the loop won't loop!)
END LOOP

Is there a way to do this another way ??
I propose to FM a new script step... EXIT IF (calc)

Will see if they add this in FM20 ? :O)

TY

JF

Reply With Quote
  #2  
Old   
Howard Schlossberg
 
Posts: n/a

Default Re: Script step.... Exit IF - 04-25-2010 , 11:05 AM






Bizouman wrote:
Quote:
I would like to have a script with multiple IF run after another
bacause they all need to be apply on a ExitField trigger.

IF#1 ....
Custom Dialog
IF YES
Do that
Else IF CANCEL
Exit Script
END IF
END IF#1
IF#2
do this
Else
Do that
EndIF#2

In that case after the 1st IF and the dialog if user select Cancel, it
will exit the current script and won't go the the 2nd IF and so on.

If I understand correctly, you want it to run test#2 even if the user
cancelled from the test#1 message?


Why not just this:

IF#1 ....
Custom Dialog
IF YES
Do that
END IF
END IF#1
#
IF#2
do this
Else
Do that
EndIF#2


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg
FM Professional Solutions, Inc. Los Angeles

FileMaker Certified Developer
Associate Member, FileMaker Business Alliance

Reply With Quote
  #3  
Old   
Your Name
 
Posts: n/a

Default Re: Script step.... Exit IF - 04-25-2010 , 03:56 PM



"Howard Schlossberg" <howard (AT) nospam (DOT) fmprosolutions.com> wrote

Quote:
Bizouman wrote:
I would like to have a script with multiple IF run after another
bacause they all need to be apply on a ExitField trigger.

IF#1 ....
Custom Dialog
IF YES
Do that
Else IF CANCEL
Exit Script
END IF
END IF#1
IF#2
do this
Else
Do that
EndIF#2

In that case after the 1st IF and the dialog if user select Cancel, it
will exit the current script and won't go the the 2nd IF and so on.


If I understand correctly, you want it to run test#2 even if the user
cancelled from the test#1 message?


Why not just this:

IF#1 ....
Custom Dialog
IF YES
Do that
END IF
END IF#1
#
IF#2
do this
Else
Do that
EndIF#2
Of maybe the Exit Script command is in the wrong place and it should be:

IF#1 ....
Custom Dialog
IF YES
Do that
Exit Script
END IF
END IF#1
#
IF#2
do this
Else
Do that
EndIF#2

so that after saying "Yes" to #1's dialog window the Script does "Do That"
and then ends without going through all the other If statements.


Helpful Harry )

Reply With Quote
  #4  
Old   
Bizouman
 
Posts: n/a

Default Re: Script step.... Exit IF - 04-27-2010 , 07:51 AM



Thank you but the script is more complicated than that, it include a
seach (if found=0) a custom dialog and a series of thing to do in the
case of no and yes.

I think I will split the script into small script and trigger a main
script untill they add this feature... because they have it in the
case of the LOOP but not for the IF.

TY

JF

Reply With Quote
  #5  
Old   
Lou Lesko
 
Posts: n/a

Default Re: Script step.... Exit IF - 04-27-2010 , 10:24 AM



On 2010-04-25 13:56:24 -0700, Your Name said:

Quote:
IF#1 ....
Custom Dialog
IF YES
Do that
Exit Script
END IF
END IF#1
#
IF#2
do this
Else
Do that
EndIF#2
Or you could use the "else if" statment.


IF#1 ....
Custom Dialog
IF YES
Do that
Exit Script
END IF
ELSE IF #2
do this
Else
Do that
EndIF#2

Also keep in mind that Exit script only exits out of the current
script, and sends you back to the calling script. To stop everything
you have to use "Halt Script".

Lou

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.