# Crystal Multi-Line "THEN" statements - RESOLVED

Charlie's suggestion to use parens to create a multi-function "then"
statement was right on the money! Worked like a charm!

Thanks again, Charlie!
--Ari

________________________________

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Ari Footlik
Sent: Thursday, April 02, 2009 10:38 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Crystal Multi-Line "THEN" statements

Linda -

I was trying really hard to avoid switching to Basic Syntax. I'm going
to try Charlie's idea of using parens, but otherwise, I guess Basic
Syntax it will have to be...

Thanks!
--Ari

________________________________

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Linda Lowney
Sent: Thursday, April 02, 2009 9:42 AM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] Crystal Multi-Line "THEN" statements

Hi Rob,

When you create the formula switch it from Crystal syntax to Basic
syntax and it will work better. You can do:

if a = 1 then
b = 2
c = 3
d = 4
else if a = z then
e = 5
f = 6
else
g = 7
h = 8
end if
end if

Don't forget the second end if.

Linda

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Ari Footlik
Sent: Thursday, April 02, 2009 10:34 AM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] Crystal Multi-Line "THEN" statements

Rob -

Thanks, but that's not exactly what I'm looking for. "Nested if's" I
could handle. What I really want is a way to perform multiple
operations if a condition is met:

if a = 1 then
b = 2
c = 3
d = 4
else if a = z then
e = 5
f = 6
else
g = 7
h = 8
end if

That's more like what I'm hoping to do.

________________________________

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Rob Bucek
Sent: Wednesday, April 01, 2009 5:12 PM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] Crystal Multi-Line "THEN" statements

Heres actually a better example; this was a calculated field in a BAQ
that I wrote...

if labordtl.labortype="I" then

if labordtl.indirectcode="PMB" then 0 else

if labordtl.indirectcode="STB" then 0 else labordtl.laborhrs

else 0

Rob Bucek

Manufacturing Engineer

PH: 715-284-5376 ext 311

FAX: 715-284-4084

<http://www.dsmfg.com/ <http://www.dsmfg.com/> <http://www.dsmfg.com/
<http://www.dsmfg.com/> > <http://www.dsmfg.com/ <http://www.dsmfg.com/>

<http://www.dsmfg.com/ <http://www.dsmfg.com/> > > >

(Click the logo to view our site)

________________________________

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Ari Footlik
Sent: Wednesday, April 01, 2009 4:14 PM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
Subject: [Vantage] Crystal Multi-Line "THEN" statements

Is it possible to put a multiple-line "THEN" statement into a Crystal
Syntax formula?

In v8 we have a user-defined "time" field that is set to be entered as a
string. In CR, I want to convert it into MINS:SECS. So, the first
thing I do is figure out if it's already set as time. To do that, I
have this formula:

local stringVar myTimeS;
//if value is already time, return the value
if (":" in {JobOper.Character02}) then
myTimeS := {JobOper.Character02}
//if value is a decimal, do <something>
else if ("." in {JobOper.Character02}) then
myTimeS := "D"
//if value is an integer, append ":00"
else
myTimeS := {JobOper.Character02} & ":00";
myTimeS := myTimeS;

For the "then" In the "else if" statement, I want to perform more
processing on the value. Is there any way to do that?

Thanks!
--Ari

[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]

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]
Is it possible to put a multiple-line "THEN" statement into a Crystal
Syntax formula?

In v8 we have a user-defined "time" field that is set to be entered as a
string. In CR, I want to convert it into MINS:SECS. So, the first
thing I do is figure out if it's already set as time. To do that, I
have this formula:

local stringVar myTimeS;
//if value is already time, return the value
if (":" in {JobOper.Character02}) then
myTimeS := {JobOper.Character02}
//if value is a decimal, do <something>
else if ("." in {JobOper.Character02}) then
myTimeS := "D"
//if value is an integer, append ":00"
else
myTimeS := {JobOper.Character02} & ":00";
myTimeS := myTimeS;

For the "then" In the "else if" statement, I want to perform more
processing on the value. Is there any way to do that?

Thanks!
--Ari
I think youre probably referring to something like a nested if-then
statement

If A = B then 1 else

If A = C then;

If B = 2 then 3 Else 0

Rob Bucek

Manufacturing Engineer

PH: 715-284-5376 ext 311

FAX: 715-284-4084

<http://www.dsmfg.com/>

(Click the logo to view our site)

________________________________

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Ari Footlik
Sent: Wednesday, April 01, 2009 4:14 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Crystal Multi-Line "THEN" statements

Is it possible to put a multiple-line "THEN" statement into a Crystal
Syntax formula?

In v8 we have a user-defined "time" field that is set to be entered as a
string. In CR, I want to convert it into MINS:SECS. So, the first
thing I do is figure out if it's already set as time. To do that, I
have this formula:

local stringVar myTimeS;
//if value is already time, return the value
if (":" in {JobOper.Character02}) then
myTimeS := {JobOper.Character02}
//if value is a decimal, do <something>
else if ("." in {JobOper.Character02}) then
myTimeS := "D"
//if value is an integer, append ":00"
else
myTimeS := {JobOper.Character02} & ":00";
myTimeS := myTimeS;

For the "then" In the "else if" statement, I want to perform more
processing on the value. Is there any way to do that?

Thanks!
--Ari

[Non-text portions of this message have been removed]
Heres actually a better example; this was a calculated field in a BAQ
that I wrote...

if labordtl.labortype="I" then

if labordtl.indirectcode="PMB" then 0 else

if labordtl.indirectcode="STB" then 0 else labordtl.laborhrs

else 0

Rob Bucek

Manufacturing Engineer

PH: 715-284-5376 ext 311

FAX: 715-284-4084

<http://www.dsmfg.com/>

(Click the logo to view our site)

________________________________

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Ari Footlik
Sent: Wednesday, April 01, 2009 4:14 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Crystal Multi-Line "THEN" statements

Is it possible to put a multiple-line "THEN" statement into a Crystal
Syntax formula?

In v8 we have a user-defined "time" field that is set to be entered as a
string. In CR, I want to convert it into MINS:SECS. So, the first
thing I do is figure out if it's already set as time. To do that, I
have this formula:

local stringVar myTimeS;
//if value is already time, return the value
if (":" in {JobOper.Character02}) then
myTimeS := {JobOper.Character02}
//if value is a decimal, do <something>
else if ("." in {JobOper.Character02}) then
myTimeS := "D"
//if value is an integer, append ":00"
else
myTimeS := {JobOper.Character02} & ":00";
myTimeS := myTimeS;

For the "then" In the "else if" statement, I want to perform more
processing on the value. Is there any way to do that?

Thanks!
--Ari

[Non-text portions of this message have been removed]
Rob -

Thanks, but that's not exactly what I'm looking for. "Nested if's" I
could handle. What I really want is a way to perform multiple
operations if a condition is met:

if a = 1 then
b = 2
c = 3
d = 4
else if a = z then
e = 5
f = 6
else
g = 7
h = 8
end if

That's more like what I'm hoping to do.

________________________________

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Rob Bucek
Sent: Wednesday, April 01, 2009 5:12 PM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Crystal Multi-Line "THEN" statements

Heres actually a better example; this was a calculated field in a BAQ
that I wrote...

if labordtl.labortype="I" then

if labordtl.indirectcode="PMB" then 0 else

if labordtl.indirectcode="STB" then 0 else labordtl.laborhrs

else 0

Rob Bucek

Manufacturing Engineer

PH: 715-284-5376 ext 311

FAX: 715-284-4084

<http://www.dsmfg.com/ <http://www.dsmfg.com/> >

(Click the logo to view our site)

________________________________

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Ari Footlik
Sent: Wednesday, April 01, 2009 4:14 PM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Subject: [Vantage] Crystal Multi-Line "THEN" statements

Is it possible to put a multiple-line "THEN" statement into a Crystal
Syntax formula?

In v8 we have a user-defined "time" field that is set to be entered as a
string. In CR, I want to convert it into MINS:SECS. So, the first
thing I do is figure out if it's already set as time. To do that, I
have this formula:

local stringVar myTimeS;
//if value is already time, return the value
if (":" in {JobOper.Character02}) then
myTimeS := {JobOper.Character02}
//if value is a decimal, do <something>
else if ("." in {JobOper.Character02}) then
myTimeS := "D"
//if value is an integer, append ":00"
else
myTimeS := {JobOper.Character02} & ":00";
myTimeS := myTimeS;

For the "then" In the "else if" statement, I want to perform more
processing on the value. Is there any way to do that?

Thanks!
--Ari

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]
if a = 1 then

(

b = 2;
c = 3;
d = 4;

)

else if a = z then
(

e = 5;
f = 6;

)

Else

(

g = 7;
h = 8;

)

~Charlie

_____

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of
Ari Footlik
Sent: Thursday, April 02, 2009 10:34 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Crystal Multi-Line "THEN" statements

Rob -

Thanks, but that's not exactly what I'm looking for. "Nested if's" I
could handle. What I really want is a way to perform multiple
operations if a condition is met:

if a = 1 then
b = 2
c = 3
d = 4
else if a = z then
e = 5
f = 6
else
g = 7
h = 8
end if

That's more like what I'm hoping to do.

________________________________

From: vantage@yahoogroups <mailto:vantage%40yahoogroups.com> .com
[mailto:vantage@yahoogroups <mailto:vantage%40yahoogroups.com> .com] On
Behalf
Of Rob Bucek
Sent: Wednesday, April 01, 2009 5:12 PM
To: vantage@yahoogroups <mailto:vantage%40yahoogroups.com> .com
Subject: RE: [Vantage] Crystal Multi-Line "THEN" statements

Heres actually a better example; this was a calculated field in a BAQ
that I wrote...

if labordtl.labortype="I" then

if labordtl.indirectcode="PMB" then 0 else

if labordtl.indirectcode="STB" then 0 else labordtl.laborhrs

else 0

Rob Bucek

Manufacturing Engineer

PH: 715-284-5376 ext 311

FAX: 715-284-4084

<http://www.dsmfg <http://www.dsmfg.com/> com/ <http://www.dsmfg
<http://www.dsmfg.com/> com/> >

(Click the logo to view our site)

________________________________

From: vantage@yahoogroups <mailto:vantage%40yahoogroups.com> .com
<mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups <mailto:vantage%40yahoogroups.com> .com
<mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Ari Footlik
Sent: Wednesday, April 01, 2009 4:14 PM
To: vantage@yahoogroups <mailto:vantage%40yahoogroups.com> .com
<mailto:vantage%40yahoogroups.com>
Subject: [Vantage] Crystal Multi-Line "THEN" statements

Is it possible to put a multiple-line "THEN" statement into a Crystal
Syntax formula?

In v8 we have a user-defined "time" field that is set to be entered as a
string. In CR, I want to convert it into MINS:SECS. So, the first
thing I do is figure out if it's already set as time. To do that, I
have this formula:

local stringVar myTimeS;
//if value is already time, return the value
if (":" in {JobOper.Character02}) then
myTimeS := {JobOper.Character02}
//if value is a decimal, do <something>
else if ("." in {JobOper.Character02}) then
myTimeS := "D"
//if value is an integer, append ":00"
else
myTimeS := {JobOper.Character02} & ":00";
myTimeS := myTimeS;

For the "then" In the "else if" statement, I want to perform more
processing on the value. Is there any way to do that?

Thanks!
--Ari

[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]
Hi Rob,

When you create the formula switch it from Crystal syntax to Basic
syntax and it will work better. You can do:

if a = 1 then
b = 2
c = 3
d = 4
else if a = z then
e = 5
f = 6
else
g = 7
h = 8
end if
end if

Don't forget the second end if.

Linda

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Ari Footlik
Sent: Thursday, April 02, 2009 10:34 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Crystal Multi-Line "THEN" statements

Rob -

Thanks, but that's not exactly what I'm looking for. "Nested if's" I
could handle. What I really want is a way to perform multiple
operations if a condition is met:

if a = 1 then
b = 2
c = 3
d = 4
else if a = z then
e = 5
f = 6
else
g = 7
h = 8
end if

That's more like what I'm hoping to do.

________________________________

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Rob Bucek
Sent: Wednesday, April 01, 2009 5:12 PM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] Crystal Multi-Line "THEN" statements

Heres actually a better example; this was a calculated field in a BAQ
that I wrote...

if labordtl.labortype="I" then

if labordtl.indirectcode="PMB" then 0 else

if labordtl.indirectcode="STB" then 0 else labordtl.laborhrs

else 0

Rob Bucek

Manufacturing Engineer

PH: 715-284-5376 ext 311

FAX: 715-284-4084

<http://www.dsmfg.com/ <http://www.dsmfg.com/> >

(Click the logo to view our site)

________________________________

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Ari Footlik
Sent: Wednesday, April 01, 2009 4:14 PM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
Subject: [Vantage] Crystal Multi-Line "THEN" statements

Is it possible to put a multiple-line "THEN" statement into a Crystal
Syntax formula?

In v8 we have a user-defined "time" field that is set to be entered as a
string. In CR, I want to convert it into MINS:SECS. So, the first
thing I do is figure out if it's already set as time. To do that, I
have this formula:

local stringVar myTimeS;
//if value is already time, return the value
if (":" in {JobOper.Character02}) then
myTimeS := {JobOper.Character02}
//if value is a decimal, do <something>
else if ("." in {JobOper.Character02}) then
myTimeS := "D"
//if value is an integer, append ":00"
else
myTimeS := {JobOper.Character02} & ":00";
myTimeS := myTimeS;

For the "then" In the "else if" statement, I want to perform more
processing on the value. Is there any way to do that?

Thanks!
--Ari

[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]
Sorry I missed the boat on that one...

Rob Bucek

Manufacturing Engineer

PH: 715-284-5376 ext 311

FAX: 715-284-4084

<http://www.dsmfg.com/>

(Click the logo to view our site)

________________________________

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Ari Footlik
Sent: Thursday, April 02, 2009 9:34 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Crystal Multi-Line "THEN" statements

Rob -

Thanks, but that's not exactly what I'm looking for. "Nested if's" I
could handle. What I really want is a way to perform multiple
operations if a condition is met:

if a = 1 then
b = 2
c = 3
d = 4
else if a = z then
e = 5
f = 6
else
g = 7
h = 8
end if

That's more like what I'm hoping to do.

________________________________

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Rob Bucek
Sent: Wednesday, April 01, 2009 5:12 PM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] Crystal Multi-Line "THEN" statements

Heres actually a better example; this was a calculated field in a BAQ
that I wrote...

if labordtl.labortype="I" then

if labordtl.indirectcode="PMB" then 0 else

if labordtl.indirectcode="STB" then 0 else labordtl.laborhrs

else 0

Rob Bucek

Manufacturing Engineer

PH: 715-284-5376 ext 311

FAX: 715-284-4084

<http://www.dsmfg.com/ <http://www.dsmfg.com/> <http://www.dsmfg.com/
<http://www.dsmfg.com/> > >

(Click the logo to view our site)

________________________________

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Ari Footlik
Sent: Wednesday, April 01, 2009 4:14 PM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
Subject: [Vantage] Crystal Multi-Line "THEN" statements

Is it possible to put a multiple-line "THEN" statement into a Crystal
Syntax formula?

In v8 we have a user-defined "time" field that is set to be entered as a
string. In CR, I want to convert it into MINS:SECS. So, the first
thing I do is figure out if it's already set as time. To do that, I
have this formula:

local stringVar myTimeS;
//if value is already time, return the value
if (":" in {JobOper.Character02}) then
myTimeS := {JobOper.Character02}
//if value is a decimal, do <something>
else if ("." in {JobOper.Character02}) then
myTimeS := "D"
//if value is an integer, append ":00"
else
myTimeS := {JobOper.Character02} & ":00";
myTimeS := myTimeS;

For the "then" In the "else if" statement, I want to perform more
processing on the value. Is there any way to do that?

Thanks!
--Ari

[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]
Charlie -

I didn't even think about using parens! I'll give that a shot and see
what happens. Thanks!

--Ari

________________________________

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Charlie Wilson
Sent: Thursday, April 02, 2009 9:40 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Crystal Multi-Line "THEN" statements

if a = 1 then

(

b = 2;
c = 3;
d = 4;

)

else if a = z then
(

e = 5;
f = 6;

)

Else

(

g = 7;
h = 8;

)

~Charlie

_____

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
Behalf Of
Ari Footlik
Sent: Thursday, April 02, 2009 10:34 AM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] Crystal Multi-Line "THEN" statements

Rob -

Thanks, but that's not exactly what I'm looking for. "Nested if's" I
could handle. What I really want is a way to perform multiple
operations if a condition is met:

if a = 1 then
b = 2
c = 3
d = 4
else if a = z then
e = 5
f = 6
else
g = 7
h = 8
end if

That's more like what I'm hoping to do.

________________________________

From: vantage@yahoogroups <mailto:vantage%40yahoogroups.com> .com
[mailto:vantage@yahoogroups <mailto:vantage%40yahoogroups.com> .com] On
Behalf
Of Rob Bucek
Sent: Wednesday, April 01, 2009 5:12 PM
To: vantage@yahoogroups <mailto:vantage%40yahoogroups.com> .com
Subject: RE: [Vantage] Crystal Multi-Line "THEN" statements

Heres actually a better example; this was a calculated field in a BAQ
that I wrote...

if labordtl.labortype="I" then

if labordtl.indirectcode="PMB" then 0 else

if labordtl.indirectcode="STB" then 0 else labordtl.laborhrs

else 0

Rob Bucek

Manufacturing Engineer

PH: 715-284-5376 ext 311

FAX: 715-284-4084

<http://www.dsmfg <http://www.dsmfg.com/ <http://www.dsmfg.com/> > com/
<http://www.dsmfg
<http://www.dsmfg.com/ <http://www.dsmfg.com/> > com/> >

(Click the logo to view our site)

________________________________

From: vantage@yahoogroups <mailto:vantage%40yahoogroups.com> .com
<mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups <mailto:vantage%40yahoogroups.com> .com
<mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Ari Footlik
Sent: Wednesday, April 01, 2009 4:14 PM
To: vantage@yahoogroups <mailto:vantage%40yahoogroups.com> .com
<mailto:vantage%40yahoogroups.com>
Subject: [Vantage] Crystal Multi-Line "THEN" statements

Is it possible to put a multiple-line "THEN" statement into a Crystal
Syntax formula?

In v8 we have a user-defined "time" field that is set to be entered as a
string. In CR, I want to convert it into MINS:SECS. So, the first
thing I do is figure out if it's already set as time. To do that, I
have this formula:

local stringVar myTimeS;
//if value is already time, return the value
if (":" in {JobOper.Character02}) then
myTimeS := {JobOper.Character02}
//if value is a decimal, do <something>
else if ("." in {JobOper.Character02}) then
myTimeS := "D"
//if value is an integer, append ":00"
else
myTimeS := {JobOper.Character02} & ":00";
myTimeS := myTimeS;

For the "then" In the "else if" statement, I want to perform more
processing on the value. Is there any way to do that?

Thanks!
--Ari

[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]

[Non-text portions of this message have been removed]
Linda -

I was trying really hard to avoid switching to Basic Syntax. I'm going
to try Charlie's idea of using parens, but otherwise, I guess Basic
Syntax it will have to be...

Thanks!
--Ari

________________________________

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Linda Lowney
Sent: Thursday, April 02, 2009 9:42 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Crystal Multi-Line "THEN" statements

Hi Rob,

When you create the formula switch it from Crystal syntax to Basic
syntax and it will work better. You can do:

if a = 1 then
b = 2
c = 3
d = 4
else if a = z then
e = 5
f = 6
else
g = 7
h = 8
end if
end if

Don't forget the second end if.

Linda

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Ari Footlik
Sent: Thursday, April 02, 2009 10:34 AM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] Crystal Multi-Line "THEN" statements

Rob -

Thanks, but that's not exactly what I'm looking for. "Nested if's" I
could handle. What I really want is a way to perform multiple
operations if a condition is met:

if a = 1 then
b = 2
c = 3
d = 4
else if a = z then
e = 5
f = 6
else
g = 7
h = 8
end if

That's more like what I'm hoping to do.

________________________________

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Rob Bucek
Sent: Wednesday, April 01, 2009 5:12 PM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] Crystal Multi-Line "THEN" statements

Heres actually a better example; this was a calculated field in a BAQ
that I wrote...

if labordtl.labortype="I" then

if labordtl.indirectcode="PMB" then 0 else

if labordtl.indirectcode="STB" then 0 else labordtl.laborhrs

else 0

Rob Bucek

Manufacturing Engineer

PH: 715-284-5376 ext 311

FAX: 715-284-4084

<http://www.dsmfg.com/ <http://www.dsmfg.com/> <http://www.dsmfg.com/
<http://www.dsmfg.com/> > >

(Click the logo to view our site)

________________________________

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Ari Footlik
Sent: Wednesday, April 01, 2009 4:14 PM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
Subject: [Vantage] Crystal Multi-Line "THEN" statements

Is it possible to put a multiple-line "THEN" statement into a Crystal
Syntax formula?

In v8 we have a user-defined "time" field that is set to be entered as a
string. In CR, I want to convert it into MINS:SECS. So, the first
thing I do is figure out if it's already set as time. To do that, I
have this formula:

local stringVar myTimeS;
//if value is already time, return the value
if (":" in {JobOper.Character02}) then
myTimeS := {JobOper.Character02}
//if value is a decimal, do <something>
else if ("." in {JobOper.Character02}) then
myTimeS := "D"
//if value is an integer, append ":00"
else
myTimeS := {JobOper.Character02} & ":00";
myTimeS := myTimeS;

For the "then" In the "else if" statement, I want to perform more
processing on the value. Is there any way to do that?

Thanks!
--Ari

[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]

[Non-text portions of this message have been removed]
Charlie's suggestion to use parens to create a multi-function "then"
statement was right on the money! Worked like a charm!

Thanks again, Charlie!
--Ari

________________________________

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Ari Footlik
Sent: Thursday, April 02, 2009 10:38 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Crystal Multi-Line "THEN" statements

Linda -

I was trying really hard to avoid switching to Basic Syntax. I'm going
to try Charlie's idea of using parens, but otherwise, I guess Basic
Syntax it will have to be...

Thanks!
--Ari

________________________________

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Linda Lowney
Sent: Thursday, April 02, 2009 9:42 AM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] Crystal Multi-Line "THEN" statements

Hi Rob,

When you create the formula switch it from Crystal syntax to Basic
syntax and it will work better. You can do:

if a = 1 then
b = 2
c = 3
d = 4
else if a = z then
e = 5
f = 6
else
g = 7
h = 8
end if
end if

Don't forget the second end if.

Linda

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Ari Footlik
Sent: Thursday, April 02, 2009 10:34 AM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] Crystal Multi-Line "THEN" statements

Rob -

Thanks, but that's not exactly what I'm looking for. "Nested if's" I
could handle. What I really want is a way to perform multiple
operations if a condition is met:

if a = 1 then
b = 2
c = 3
d = 4
else if a = z then
e = 5
f = 6
else
g = 7
h = 8
end if

That's more like what I'm hoping to do.

________________________________

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Rob Bucek
Sent: Wednesday, April 01, 2009 5:12 PM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] Crystal Multi-Line "THEN" statements

Heres actually a better example; this was a calculated field in a BAQ
that I wrote...

if labordtl.labortype="I" then

if labordtl.indirectcode="PMB" then 0 else

if labordtl.indirectcode="STB" then 0 else labordtl.laborhrs

else 0

Rob Bucek

Manufacturing Engineer

PH: 715-284-5376 ext 311

FAX: 715-284-4084

<http://www.dsmfg.com/ <http://www.dsmfg.com/> <http://www.dsmfg.com/
<http://www.dsmfg.com/> > <http://www.dsmfg.com/ <http://www.dsmfg.com/>

<http://www.dsmfg.com/ <http://www.dsmfg.com/> > > >

(Click the logo to view our site)

________________________________

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Ari Footlik
Sent: Wednesday, April 01, 2009 4:14 PM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
Subject: [Vantage] Crystal Multi-Line "THEN" statements

Is it possible to put a multiple-line "THEN" statement into a Crystal
Syntax formula?

In v8 we have a user-defined "time" field that is set to be entered as a
string. In CR, I want to convert it into MINS:SECS. So, the first
thing I do is figure out if it's already set as time. To do that, I
have this formula:

local stringVar myTimeS;
//if value is already time, return the value
if (":" in {JobOper.Character02}) then
myTimeS := {JobOper.Character02}
//if value is a decimal, do <something>
else if ("." in {JobOper.Character02}) then
myTimeS := "D"
//if value is an integer, append ":00"
else
myTimeS := {JobOper.Character02} & ":00";
myTimeS := myTimeS;

For the "then" In the "else if" statement, I want to perform more
processing on the value. Is there any way to do that?

Thanks!
--Ari

[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]

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]