I hope you are not intending to put this code into production anywhere.
Instead of your code, try:
MOVE ‘ABC,1,2,3,4,5,6,7,8,9’ TO #TXTA
Assuming that the numbers you want to add are not really 1…9 but numbers in an array, try:
COMPRESS #TXTA #ARRAY (*) INTO #TXTA WITH DELIMITER ‘,’
You might want (as you had above), ALL DELIMITERS, if #ARRAY is alpha. Then a blank entry in #ARRAY would produce something like 1,2,4 etc
This would not happen if #ARRAY was numeric. COMPRESS with a zero value would result in a string such as 1,2,0,4 etc
Finally, two points. First, using the FOR loop as you showed above is about as inefficient a way to do this as exists in Natural (okay, i guess if you really tried you could do something like):
FOR #I = 1 to 9
COMPRESS #TXTA #I INTO #TXTA LEAVING NO SPACE
COMPRESS #TXTA ',' INTO #TXTA LEAVING NO SPACE
END-FOR
Next, please get a Natural class and do not try to learn Natural by yourself. You will end up writing horrible code.
steve