on 06-24-2010 5:36 PM
I have the following code in a Formula Field
WhilePrintingRecords;
Shared numberVar counter;
//increments the loop so that all parameter entries can be displayed
Shared stringVar CC_display;
select HasValue({?PF_EqClassCode})
case true :
CC_display := "Class Codes: " + Chr(10);
for counter := 1 to Count({?PF_EqClassCode}) do
(
CC_display := CC_display + ToText({?PF_EqClassCode}[counter],0,"") + " | ";
)
case false :
CC_display := "Class Codes: All";
CC_display;
When I test it the last three lines are highlighted and I get the message:
"The remaining text does not appear to be part of the formula."
I cannot figure out what I am doing wrong.
Thanks
Try making this change:
WhilePrintingRecords;
Shared numberVar counter;
//increments the loop so that all parameter entries can be displayed
Shared stringVar CC_display;
select HasValue({?PF_EqClassCode})
case true : ( //Add open paren
CC_display := "Class Codes: " + Chr(10);
for counter := 1 to Count({?PF_EqClassCode}) do
(
CC_display := CC_display + ToText({?PF_EqClassCode}counter,0,"") + " | ";
)
) //Add close paren
case false : (//Add open paren
CC_display := "Class Codes: All";
) //Add close paren
CC_display;
The issue is that you're trying to run two lines of code within the first part of the case statement, so Crystal doesn't recognize the second part.
If this doesn't work, you'll have to move the For loop so a separate formula that returns a string and change the code to somethign like this:
WhilePrintingRecords;
Shared numberVar counter;
//increments the loop so that all parameter entries can be displayed
Shared stringVar CC_display;
select HasValue({?PF_EqClassCode})
case true :
CC_display := "Class Codes: " + Chr(10) + {@NewForLoopFormula};
case false :
CC_display := "Class Codes: All";
CC_display;
-Dell
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.