Lbass
A few weeks ago you posted the following solution to remove chr(13) + chr(10) from a field. This formula seemed to be working perfectly however occasionally the address database field can be a null and I get the following error message:
"String length is less than 0 or not an integer".
Do I do add a strlength or a isnull option to the following piece of code?
Hope you can help.
whileprintingrecords;
numbervar counter := 0;
stringvar orig := {tblAuthorisations.Address};
stringvar norets := replace({tblAuthorisations.Address},chr(13),chr(10));
stringvar noretsorlinefeeds := replace(norets,chr(10),"");
numbervar i := len(orig) - len(noretsorlinefeeds);
stringvar result := "";
numbervar counterx := 0;
for counter := 1 to i do(
if ucase(left(split(norets,chr(10))[counter],1)) in ["A" to "Z","1" to "9"] then
counterx := counterx + 1);
left(orig, len(orig) - (i - counterx + 1));
A few weeks ago you posted the following solution to remove chr(13) + chr(10) from a field. This formula seemed to be working perfectly however occasionally the address database field can be a null and I get the following error message:
"String length is less than 0 or not an integer".
Do I do add a strlength or a isnull option to the following piece of code?
Hope you can help.
whileprintingrecords;
numbervar counter := 0;
stringvar orig := {tblAuthorisations.Address};
stringvar norets := replace({tblAuthorisations.Address},chr(13),chr(10));
stringvar noretsorlinefeeds := replace(norets,chr(10),"");
numbervar i := len(orig) - len(noretsorlinefeeds);
stringvar result := "";
numbervar counterx := 0;
for counter := 1 to i do(
if ucase(left(split(norets,chr(10))[counter],1)) in ["A" to "Z","1" to "9"] then
counterx := counterx + 1);
left(orig, len(orig) - (i - counterx + 1));