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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

the word else is missing?? Crystal formulas killing me 3

Status
Not open for further replies.

slim2

Programmer
Oct 18, 2001
94
I keep getting the word else is missing. What am I missing?? There is no information to indicate anything is wrong in crystal help.

If not inRepeatedGroupHeader Then
(
Global NumberVar Array TotLnDol := [0,0,0,0,0,0,0,0,0,0,0,0,0];
Global numberVar Array NonAcDol := [0,0,0,0,0,0,0,0,0,0,0,0,0];
)

Thanks
 
you have to end an if then statement with an else

If not inRepeatedGroupHeader Then
(
Global NumberVar Array TotLnDol := [0,0,0,0,0,0,0,0,0,0,0,0,0];
Global numberVar Array NonAcDol := [0,0,0,0,0,0,0,0,0,0,0,0,0];
) else 0 Seagate Certified RCAD Specialist.
-Bruce Thuel-Chassaigne
roadkill150@hotmail.com
 
Thanks for the promt reply, now I get the following message

The array must be subscripted.
 
Actually the ELSE isn't necessary in this case. The problem is that the THEN can't end with an array, so you need something after that for the formula to return.

If not inRepeatedGroupHeader Then
(
Global NumberVar Array TotLnDol := [0,0,0,0,0,0,0,0,0,0,0,0,0];
Global numberVar Array NonAcDol := [0,0,0,0,0,0,0,0,0,0,0,0,0];0
)
Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Ken is right...this is the problem with your formula

the same would happen if you removed the If-then

Since a formula cannot end with an array I usually let it have a null value. Serves the same purpose and since you are not displaying the formula nothing is harmed

@initialize

Global NumberVar Array TotLnDol := [0,0,0,0,0,0,0,0,0,0,0];
Global numberVar Array NonAcDol := [0,0,0,0,0,0,0,0,0,0,0];
"";


 
Thanks a lot guys. You have been a big help.

Is there a book or manual somewhere that describes this, or is it no pain no gain.
 
Arrays aren't covered very much in CR courses or reference materials, probably because most users don't have much use for them. Actually, up until v8, you couldn't even update a single element in an array. So, before v8 there weren't many practical uses for them IMHO. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
ken,

I saw your book on your website on report sepecifications and am getting it. If you would ever do a cookbook on Crystal functions and events, how they work and what the quirks are I sure would get it.

Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top