[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: [sqr-users] RE: Nested Evaluate with multiple conditions???
Hey Darrel!
Maybe you can shorten your logic:
Evaluate &A
When='1'
Evaluate &B
When='1'
When='2'
When='3'
Break
When-Others
Do Blah
End-Evaluate
Break
When-Others
Do Blah
End-Evaluate
But if you seriously want to clarify your logic:
LET $Lets-Do-It = "NO"
IF &A = 1
IF &B <>1 AND &B <> 2 AND &B <> 3
LET $Lets-Do-It = "YES"
END-IF
ELSE
! IF &A IS NOT 1
LET $Lets-Do-It = "YES"
END-IF
IF $Lets-Do-It = " YES"
DO The-Next-Step
END-IF
Happy computing,
Ken Gartman
Darrel Scott wrote:
>Denise -
>
>Let me start over. I have a situation where if the value from &A is not equal
>to 1, perform the next step. If the value from &A is equal to 1, then the
>value of &B must be evaluated. If &B is then equal to 1 or 2 (or 3 for that
>matter - hey, I didn't create this logic), do nothing. Otherwise perform the
>next step.
>
>Based on this the comments I received from this thread and the SQR book, this
>is what my final code looks like.
>
>Evaluate &A
> When='1'
> Evaluate &B
> When='1'
> Break
> When='2'
> Break
> When='3'
> Break
> When-Others
> Do Blah
> End-Evaluate
>Do blah
>When-Others
> Do Blah
>
>End-Evaluate
>
>I've placed several " #DEBUG Show " statements throughout this evaluate logic
>and it does exactly what I want it to do (unless SQR is lying to me).
>
>Thanks again for yours (and everyone's input).
>
>- Darrel
>
>
>"White, Denise" <DEWhite@vicr.com> wrote:
>Now you have me confused. You are saying that you want it to evaluate to true
>if EITHER it is not equal to 1 OR it is not equal to 2? If that is the case,
>then every single value will be passed, and there is no need to even put that
>condition in. Obviously, 1 is not equal to 2, and 2 is not equal to 1, so both
>of those values would be passed through, as well as all other values which are
>not equal to 1 and not equal to 2. If you are going to use a condition that is
>not going to filter out anything, just leave it out. Also, this is the logic
>that your original message said did not work, and now you are saying that
>you've tested it, and it does work, after all.
>
>I was under the impression that what you wanted was something that was not
>equal to 1 AND it was not equal to 2. That type of logic would pass everything
>EXCEPT 1 and 2. If that were the case, then I would agree with all of the
>respondents below.
>
>Denise M. White
>Sr. Software Engineer
>Vicor
>--__--__--
>
>Message: 8
>Date: Thu, 18 Dec 2003 13:55:43 -0800 (PST)
>From: Darrel Scott
>Subject: RE: [sqr-users] Nested Evaluate with multiple conditions???
>To: sqr-users@sqrug.org
>Reply-To: sqr-users@sqrug.org
>
>Larry -
>
>Thanks for your advice. Actually, the latter is what I want it to do. In my
>case, &B will NEVER equal two values at the same time. So am EITHER-OR logic
>is what I need here. I've tested this and it worked for me.
>
>Thanks again.
>- Darrel
>
>Larry Roux wrote:
>Agreed. Or at least something like
>
>Evaluate &A
>When='1'
>if &B != 2 and &B != 3
>Do blah
>End-If
>End-Evaluate
>
>I think the
>When!='1'
>When!='2'
>Do blah
>
>will pass to "Do Blah" if EITHER When!='1' OR When!='2' is true. This is NOT
>an AND.
>
>
>
>
>
>******************************
>Larry Roux
>Syracuse University
>lroux@syr.edu
>*******************************
>
>
>
>>>>GJANSEN@aflcio.org 12/18/03 02:18PM >>>
>>>>
>>>>
>Agreed, but why even nest? Why not
>
>If &A = 1 and &B != 2 and &B != 3
>do Blah
>End-If
>
>
>
>
>
>>>>SVH@CDRH.FDA.GOV 12/18/03 09:13AM >>>
>>>>
>>>>
>I think this sort of logic will better be handle in an "If then else"
>construct.
>
>
>-----Original Message-----
>From: Darrel Scott [mailto:darrel_1977@yahoo.com]
>Sent: Wednesday, December 17, 2003 5:49 PM
>To: sqr-users@sqrug.org
>Subject: [sqr-users] Nested Evaluate with multiple conditions???
>
>
>
>Hello all -
>
>I'm trying to get this EVALUATE code to work....
>
>Evaluate &A
>When='1'
>Evaluate &B
>When!='1'
>When!='2'
>Do blah
>End-Evaluate
>End-Evaluate
>
>In a nutshell, if &A is equal to 1 and &B is NOT equal to 1 or 2 do
>"blah".
>
>What am I doing wrong?
>
>Thanks in advance.
>
>_______________________________________________
>sqr-users mailing list
>sqr-users@sqrug.org
>http://www.sqrug.org/mailman/listinfo/sqr-users
>
>
>---------------------------------
>Do you Yahoo!?
>New Yahoo! Photos - easier uploading and sharing
>
>_______________________________________________
>sqr-users mailing list
>sqr-users@sqrug.org
>http://www.sqrug.org/mailman/listinfo/sqr-users
>
>
>
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users