Method Community

 

Nesting Conditional Statements

Last post 02-21-2011 11:57 AM by jnoneiliv1. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 02-20-2011 4:09 PM

    • jnoneiliv1
    • Top 50 Contributor
    • Joined on 05-17-2010
    • Richmond, Virginia, USA
    • Posts 171

    Nesting Conditional Statements

    Can conditional statements be nested like typical If, Then, ElseIf, Else logic?  For example two Start conditional logic statements in row followed by two End conditional statements to create a nested logic.

    Or, must any Start conditional statement be followed by it's End statement?

    The Actions guide is vague on this point of usage and includes no examples of nested logic although it doesn't prohibit its use.

    Also, as a corallary, is it okay to use the Stop Processing More Actions statement to branch out of the logic?  With some clever arrangement it would appear possible to create most If, Then, ElseIf, Else logic using this as a way to stop processing when the condition is met.  Again, the Actions Guide has some vague language about this, so it's hard to really tell when this is used.

    Cheers,

    James

     

    James ONeil
    O. K. Foundry Co., Inc.
    1005 Commerce Rd.
    Richmond, Virginia 23224
  • 02-21-2011 10:35 AM In reply to

    Re: Nesting Conditional Statements

    Answer

     Hi James,

    Yes, Method is capable of handling nested conditional statements. Give it a try and I’m sure you will find it works as you hope. You are right, the Actions reference guide does not explicitly state that conditional statements can be nested but it also does not state that they cannot be nested. The Actions reference guide is meant to serve as a reference only. This is good feedback and perhaps we can include it in future revisions.
     
    To answer your 2nd question about the Stop Process more actions,  take a look at the Show Message action. You will see several options in this action.

    1. No Decision
    2. Provide Yes/No option to user? (‘No’ will mean no further actions get processed).
    3. Provide Yes/No option to user? (‘Ok’ assigns True. ‘Cancel’ assigns False.)

    Sounds like you might want to play around with the 3rd option. This will Assign result name which can be used in subsequent actions including conditional statements.

    Hope this helps,

     

    Need more help? Ask us about Method consulting services.

    Valbon Shabani
    Director of Education
    Method Integration Inc.
    Toll Free: 1.888.925.6238 ext. 715
    Local and overseas: 416.847.0400 ext. 715
    Fax: 416.640.6027
    E-mail: valbon@method.me
    Website: http://www.linkedin.com/in/valbon
  • 02-21-2011 11:57 AM In reply to

    • jnoneiliv1
    • Top 50 Contributor
    • Joined on 05-17-2010
    • Richmond, Virginia, USA
    • Posts 171

    Re: Nesting Conditional Statements

    Great!  Now I'm really excited. Thanks for confirming this. 

    The screen designer combined with Actions is really an amazing tool to build an inferface.  It really keeps the user out of trouble while providing tons of functionality.

     

     

     

    James ONeil
    O. K. Foundry Co., Inc.
    1005 Commerce Rd.
    Richmond, Virginia 23224
Page 1 of 1 (3 items)