Hello, hope one or more of you can shed some light. I am using Crystal 8.5 and have a string variable I created to show parameters entered in a report. For example if the user enters, DB, AC, CD etc. then this formula will print the parameters entered at the top of the report. What I'd like to be able to do is have this list sorted alphabetically. Here is the code I'm using to concatenate the strings together...the results desired would be AC, CD, DB. Any help is appreciated.
rem MULTIPLE PARAMETERS TO PRINT AT THE TOP OF A REPORT
rem Declare a string variable x
WhilePrintingRecords:
shared b as string:
dim i as number:
i = 1:
rem Loop for the number of elements in the parameter
rem where 'b' is assigned to itself plus parameter 'i'
rem and then increment i, on last loop don't add "," to end of parameter list
for i = 1 to count({?Category Code})
if i <= (count({?Category Code})-1) then
b = b + {?Category Code}(i) + ", "
else
b = b + {?Category Code}(i)
end if
Next
formula = ucase(b)
rem IF * is entered then print (All Codes)
if formula = "*" then
formula = "(All Codes)"
end if
rem MULTIPLE PARAMETERS TO PRINT AT THE TOP OF A REPORT
rem MULTIPLE PARAMETERS TO PRINT AT THE TOP OF A REPORT
rem Declare a string variable x
WhilePrintingRecords:
shared b as string:
dim i as number:
i = 1:
rem Loop for the number of elements in the parameter
rem where 'b' is assigned to itself plus parameter 'i'
rem and then increment i, on last loop don't add "," to end of parameter list
for i = 1 to count({?Category Code})
if i <= (count({?Category Code})-1) then
b = b + {?Category Code}(i) + ", "
else
b = b + {?Category Code}(i)
end if
Next
formula = ucase(b)
rem IF * is entered then print (All Codes)
if formula = "*" then
formula = "(All Codes)"
end if
rem MULTIPLE PARAMETERS TO PRINT AT THE TOP OF A REPORT