Thank you...
I knew I wasn't doing it just right, but it worked, so I left it.
Aaron
-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]On Behalf Of
netrippers
Sent: Monday, August 21, 2006 5:37 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: Multiple comparisons in BAM
Aaron
In the case stament use the DO: END.
CASE c:
WHEN 0 THEN
Return "Cancel Send":U.
WHEN 1 THEN DO:
This stament.
That stament.
END.
WHEN 2 OR WHEN 5 THEN DO:
...
...
END.
OTHERWISE...
END CASE.
I knew I wasn't doing it just right, but it worked, so I left it.
Aaron
-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]On Behalf Of
netrippers
Sent: Monday, August 21, 2006 5:37 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: Multiple comparisons in BAM
Aaron
In the case stament use the DO: END.
CASE c:
WHEN 0 THEN
Return "Cancel Send":U.
WHEN 1 THEN DO:
This stament.
That stament.
END.
WHEN 2 OR WHEN 5 THEN DO:
...
...
END.
OTHERWISE...
END CASE.
--- In vantage@yahoogroups.com, "Aaron Hoyt" <aaron.hoyt@...> wrote:
>
> Rich,
>
> I can't talk about "proper", I have never had proper training, but I can
> tell you what I would do.
> Give something like this a shot.
>
> DEFINE VARIABLE type AS CHARACTER INITIAL "PACK, BEND" NO-UNDO.
> IF Eff < 80 AND LOOKUP (JobOper.OpCode, type) > 0 THEN DO:
>
> You can simply add more comma separated items to the variable to
create more
> compare statements.
> Also...I find this very effective in setting up case statements.
> For instance, I print a different label upon receipt based on the
type of
> receipt...
>
> DEFINE VARIABLE type AS CHARACTER INITIAL
> "PUR-UKN,PUR-STK,PUR-INS,PUR-MFG,PUR-SUB" NO-UNDO.
> DEFINE VARIABLE c AS INTEGER INITIAL 0 NO-UNDO.
> c = LOOKUP (RcvDtl.ReceivedTo, type).
> CASE c:
> WHEN 0 THEN
> Return "Cancel Send":U.
> WHEN 1 THEN...
> WHEN 2 THEN...
> ...
> OTHERWISE...
> END CASE.
>
> One trick with Case statements that I have found is that I can't get
it to
> recognize more than one statement per case, so I tend to enclose
everything
> within each case (WHEN...) inside an IF statement, unless I only
have one
> statement anyway.
>
> Good luck,
> Aaron Hoyt
> Vantage Plastics
> -----Original Message-----
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]On
Behalf Of
> RICH WAGNER
> Sent: Monday, August 21, 2006 10:05 AM
> To: vantage@yahoogroups.com
> Subject: [Vantage] Multiple comparisons in BAM
>
>
> I am trying to write a BAM that will send and email to the Manager
based
> on the JobOper.OpCode. Each Manager is in charge of several
workcenters
> so I am trying to write an IF statement like the following.
>
> IF Eff < 80 AND JobOper.OpCode = ["PACK","BEND"]
>
> THEN DO:
>
> I could write a bunch of OR statements but I would rather not.
>
> Does anyone know the proper syntax to use in this situation?
>
> Thanks,
>
> Rich
>
> [Non-text portions of this message have been removed]
>
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
[Non-text portions of this message have been removed]