changing string in memo
I am running RB7.02, D7, WinXP.
My GroupFooterAfterPrint Event has a line like the following:
Memo3.Lines[0] := newstring;
The event blows an error. There is at least 10 lines in the memo and if I
put a showmessage(Memo3.Lines[0]) call before the line above it works fine.
All calls to Memo3.Lines.Add(str) work fine.
Any ideas?
Yelena
My GroupFooterAfterPrint Event has a line like the following:
Memo3.Lines[0] := newstring;
The event blows an error. There is at least 10 lines in the memo and if I
put a showmessage(Memo3.Lines[0]) call before the line above it works fine.
All calls to Memo3.Lines.Add(str) work fine.
Any ideas?
Yelena
This discussion has been closed.
Comments
It works fine in tests here. What other code do you have that is relying on
this memo? What are you trying to do by changing the memo after the group
footer prints? In which band is the memo? If you still can't resolve the
issue, please send a zimple example that reproduces the problem to
support@digital-metaphors.com and we'll be happy to take a look at it.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
Memo1 and 2 are located in the summary section of the report.
var
s : String;
i : Integer;
begin
{ format string to exact length before looking in memo field }
s := FormatString('AAAAAAAAAAAAAAA', PipeBody['DEP_DESC_1']);
i := Memo2.Lines.Indexof(s);
if i < 0 then
Memo2.Lines.Add(s)
else
Memo3.Lines[i] := 'Duplicate ' + s;
end;
It seems to work fine in RAP:
http://www.digital-metaphors.com/tips/SetSummaryMemoInGroupEvent.zip
See if you can reproduce the problem with this and send it back to me (attn
Jim) support@digital-metaphors.com
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
There is no line that states 'Duplicate' + s.
The error occurs only when that else part is in effect.
What should I do?
lines in order to references Memo3.Lines[n]. Try adding blank lines to the
Memo3 in the report when in the designer if you want to specify the nth line
to be 'Duplicate' + s. That should do the trick.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com