Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

problem with string dynamically created

Former Member
0 Likes
648

Hi all,

I have a problem a bit complex I don't know how to solve it: I have a dynamically created program that give a syntax error because a string created inside it is too long and don't stay on a single line, so the program created has some lines like this:

tot = d_1 + d_2 + d_3 + d_4 + d_5 + 
d_6 + d_7 +  d_8 + d_9 .

this code doesn't pass the syntax-check before it is executed and the error given is about the second line. So how can I avoid this error ? remember that the program is dynamically created so the code reported is for sample: it's possible to have more than 2 lines.

Thanks to anyone will give me an hint.

Gabriele

5 REPLIES 5
Read only

Former Member
0 Likes
631

Hello

Try this:


ADD d_1 THEN d_2 UNTIL d_9 GIVING tot.

Read only

Former Member
0 Likes
631

give some more explanation if possible..

Read only

0 Likes
631

Hi!

Explicitely control the length of your statements when generating them. In your sample you could code your program to create the follwoing lines:

tot = d1 + d2 + ........ + d8.

tot = tot + d9 + d100 ...... + d150.

tot = tot + d151 ..... d999.

And so on ....

Regards,

Volker

Read only

Former Member
0 Likes
631

1) Can you modify this dynamically created program,

2) or can you change the program which creates this dynamic program?

Read only

0 Likes
631

thanks to all I solved by myself but I'll explain anyway what was wrong: the error was not due string too long but due a characters that was cut when filling the tab containing the code of the report dynamically created (my fault)(d'oh) and because the system is old I was thinking that doesn't like line command on more line as I wrote above and the error shown did not give me more informations.

thanks to all and sorry