‎2005 Dec 28 3:28 AM
Hi,
How can i make a text symbol's text change during runtime?
All i can remember is that i need to set its value in GoTo > Text Elements > Text Symbols to '&'...
Thanks!
‎2005 Dec 28 3:39 AM
You can not change the value of a text element at design time nor at runtime. You must use a variable field. For example, take the following code. In this code, it passes a syntax check, but will give you a runtime error because you are trying to write to a protect field.
report zrich_0002.
field-symbols: <fs>.
write:/ text-001.
assign text-001 to <fs>.
replace '&' with 'Test' into <fs>.
Write:/ <fs>.
You must use a variable field. Take this code for example.
report zrich_0002.
data: a_text_field type string.
field-symbols: <fs>.
write:/ text-001.
a_text_field = text-001.
replace '&' with 'Test' into a_text_field.
write:/ a_text_field.
Regards,
Rich Heilman
‎2005 Dec 28 4:24 AM
‎2005 Dec 28 5:08 AM
For example, i have a text symbol text-001.
given condition A, i need to display 'Condition A', else i need to display 'Other Condition'.
Is that possible?
‎2005 Dec 28 5:12 AM
‎2005 Dec 28 6:54 AM
Hi winnie,
1. since text-symbol cannot be changed,
2. we can use simple variables
3. OR we can define 2 text elements.
001
002
and accordingly display
based upon the condition.
-- something like this.
if condition 1.
text-001.
else.
text-002.
endif.
4. It is always better to use text-elements
so that the program can be used
in other languages (in near future, if required)
regards,
amit m.
Message was edited by: Amit Mittal