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

Switch Function - Maximum Number of Arguments

Status
Not open for further replies.
Jan 8, 2002
12
US
What is the maximum number of arguments I can use with a switch function in Crystal 8.0? I tried to create a very long formula using switch (using Crystal to write the code for me...I'm not completely insane...just a little) and got the error message "Too many arguments have been given to this function." Thanks.
 
What does "using Crystal to write it" mean?

And how long is this very long formula?

Too many arguments implies that it's ill formed, not excessive in length.

Perhaps if you pasted it here we might be able to analyze it for you.

-k kai@informeddatadecisions.com
 
The formula is a very basic switch formula, switching a list of 708 zip codes to town names. It would take up to 14 pages to print, so I don't think you want it pasted here.

I wasn't about to actually write all 708 zips and town names, so I created a very simple Crystal Report to do it for me:
Code:
Switch {Field1} startswith "{Zip}", "{TownName}"
in details, repeating 708 times. Then I copy and paste it into an actual formula.

It can not be done through table look up due to nine vs five digit zips, but works fine with an if-then-else formula. Linking subreports works, but takes way too much time to run, so that's not a solution.

The switch formula wortks fine for a smaller list of only 75 zip codes, but 708 seems to be just too many.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top