Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal syntax problem

Status
Not open for further replies.

viatorg

IS-IT--Management
Jun 17, 2004
4
0
0
US
Hi all,

Not sure if I'm in the correct forum, sorry if I'm not.

Having problem with the following crystal syntax. I's only
showing some of the records information, and not all. If I take away everything except just the last "if else" statement it seems to work fine.

Local StringVar status1 := {TempERCP.Status};
Local StringVar status2 := {TempERCP.Status2};
Local StringVar status3 := {TempERCP.Status3};
Local StringVar Diag1;


IF status1 = "proven" then
(
status1 := "";
Diag1 := " Diagnosis"
)
Else
(
status1 := Replace({TempERCP.Status},left({TempERCP.Status},1),uppercase(left({TempERCP.Status},1)),1,1);
Diag1 := " diagnosis"
);

IF status2 = "proven" then
status2 := ""
Else
status2 := {TempERCP.Status2};

IF status3 = "proven" then
status3 := ""
Else
status3 := {TempERCP.Status3};



IF NOT (isnull({TempERCP.Diagnosis})) and isnull({TempERCP.Diagnosis2}) and isnull({TempERCP.Diagnosis3}) then
status1 + Diag1 + " of " + {TempERCP.Diagnosis} + "."

Else if not (isnull({TempERCP.Diagnosis})) and not (isnull({TempERCP.Diagnosis2})) and isnull({TempERCP.Diagnosis3}) then
status1 + Diag1 + " of " + {TempERCP.Diagnosis}
+ " and a " + status2 + " diagnosis of " + {TempERCP.Diagnosis2} + "."

Else if not (isnull({TempERCP.Diagnosis})) and not (isnull({TempERCP.Diagnosis2})) and not (isnull({TempERCP.Diagnosis3})) then
status1 + Diag1 + " of " + {TempERCP.Diagnosis} + ", a "
+ status2 + " diagnosis of " + {TempERCP.Diagnosis2}
+ " and a " + status3 + " diagnosis of " + {TempERCP.Diagnosis3} + "."

thanks for your help
Gerry
 
Maybe it's just too complex. Why not try breaking it down into several separate formulas?

Madawc Williams (East Anglia)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top