Link to home
Start Free TrialLog in
Avatar of angeleam
angeleam

asked on

How do I limit the number of characters returned in a variable.

I am receiving the following error with this formula in Crystal XI.

A string can be at most 65534 characters long.

How do I limit the number of characters returned?

Here is the formula that the report is bombing out on.
 
whileprintingrecords;
stringvar x:=x+{Database.NOTES}
 
Type = String and Length is 1000

Open in new window

Avatar of Mike McCracken
Mike McCracken

Do you need to display the full string even if it is over 64K?

You can do this

If Len(x) < 64533 then
   x := x + {Database.NOTES}

If you need to display the full string there are ways using arrays of strings.

mlmcc
Avatar of angeleam

ASKER

I don't need to print if it is over 64. when I use this formula I receive an error: The ) is missing. and it highlights (x)
Did you add that to your formula as shown below.

whileprintingrecords;
stringvar x;
If Len(x) < 64533 then
   x := x + {Database.NOTES}

mlmcc
I left out the ;. I think this formula will work for me. Thank you for your reply.
After validating my data how would display the text if it is over 65534?
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank You