IF StandardTextCode <> '' THEN BEGIN ExtTextLine.RESET; ExtTextLine.SETRANGE(ExtTextLine."Table Name",ExtTextLine."Table Name"::"Standard Text"); ExtTextLine.SETRANGE(ExtTextLine."No.",StandardTextCode); ExtTextLine.SETFILTER(ExtTextLine.Text,'<>%1',''); IF ExtTextLine.FINDSET THEN REPEAT IF (STRLEN(Stdtext1) + STRLEN(ExtTextLine.Text)) <= 1000 THEN Stdtext1 := Stdtext1 + ' '+ExtTextLine.Text ELSE IF (STRLEN(Stdtext2) + STRLEN(ExtTextLine.Text)) <= 1000 THEN Stdtext2 := Stdtext2 + ' '+ExtTextLine.Text ELSE IF (STRLEN(Stdtext3) + STRLEN(ExtTextLine.Text)) <= 1000 THEN Stdtext3 := Stdtext3 + ' '+ExtTextLine.Text ELSE IF (STRLEN(Stdtext4) + STRLEN(ExtTextLine.Text)) <= 1000 THEN Stdtext4 := Stdtext4 + ' '+ExtTextLine.Text UNTIL ExtTextLine.NEXT = 0; END;
Comments
The problem is in the code only. its wrong. Thank you.
if so, you're adding them together, but you are also new adding a new space [+' '+] so if was 1000 now it's 1001. So assuming STDTEXT1 length is 1000 you now have an overflow.
IF (STRLEN(Stdtext1) + STRLEN(ExtTextLine.Text)) <= 1000 THEN
Stdtext1 := Stdtext1 + ' '+ExtTextLine.Text
http://www.BiloBeauty.com
http://www.autismspeaks.org
But this error comes when i place the textbox to capture StdText1+' '+Stdtext2. suppose if i place this text box in the fotter of a dataitem then rest of the things are printing but afater this footer the report is breaking. i checked the Max length property also of the text box and set the autoenter to yes.
the total no of characters in my extended lines are nearly 1051.
And when i place 2 texboxes to take stdtext1 and stdtext2 respectvely it working fine.
if this was an overflow error than half of the report will not print. Am i right?
What's happening if the value is >?
The code appears not to handle this.
If this plus that <= to 1000 the str1 has a value if it's not you go right to str2 with no more regards to str1.
Have you thought about using an array?
Do you have code to clear the Stdtext(1-4) after it's run though?
http://www.BiloBeauty.com
http://www.autismspeaks.org
I doubt that i am trying to insert data in a text box of length more than 1056. I tried to put condition well before the variables have data of length 1000. so i modified my condition as stdText1 < 900 but keep the size of variable 1000. So whenever i used source expression of the textbox as StdText1 its working fine but when i use the sourceexp as StdText1 + StdText2 then only i get this error.