DrawCommand - temporarily store a string
Hello,
I need to temporarily store a string (up to 22 characters) for each
DrawCommand on my report.
This value will need to be retrieved on the OnClick event.
I know the Tag property is provided for this purpose, but it only stores an
integer. Is there any way around this so that I can store a string?
--- posted by geoForum on http://www.newswhat.com
I need to temporarily store a string (up to 22 characters) for each
DrawCommand on my report.
This value will need to be retrieved on the OnClick event.
I know the Tag property is provided for this purpose, but it only stores an
integer. Is there any way around this so that I can store a string?
--- posted by geoForum on http://www.newswhat.com
This discussion has been closed.
Comments
The Tag property in Delphi can be used for storing an additional integer
value or it can be typecast to component reference or a pointer.
One (easiest) option would be to create an object or use a pre-existing
one such as TStringList and use it to hold your string.
DrawCommand.Tag := Integer(lStringList);
...
lMyText := TStringList(DrawCommand.Tag).Text;
Another is create and allocate a string pointer and assign to the Tag.
This is a bit more involved due to the fact that memory needs to be
allocated for the string with Unicode characters taken into account.
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Many thanks! I'm not a Delphi programmer at all, but I managed to fumble my
way through it and have achieved what I needed.
Your assistance was very useful - thanks again!
Jay
--- posted by geoForum on http://www.newswhat.com