Split String

Dear all,

please tell me , how can i split a lengthy string in a Message???

I W’d appreciate if anyone could answer this

Regards

Rose[:)]

Hi Rose,

I would suggest to use a combination of COPYSTR and DELSTR.

Say you have a string that is max 250 chars, and you want to split it into 5 substrings of 50 chars.
I would do something like this:

FOR i := 1 TO 5 DO BEGIN
IF STRLEN(MyInputString) > 50 THEN BEGIN
MySubString[i] := COPYSTR(MyInputString,1,50);
MyInputString := DELSTR(MyInputString,1,50);
ELSE BEGIN
MySubString[i] := MyInputString;
MyInputString := ‘’;
END;
END;

This is of course a very simple example, but it might give an idea.
In fact you might want to split the string at a given character instead of a given position. In this case you also have to use the STRPOS to determine the position of the character that defines the split.

Hi,

do you mean to put output a MESSAGE with multiple lines?

That would be done with \

E.g. MESSAGE(‘first line\second line’)

OK…
totally missed that one… Sorry.

The way to define a linebreak in a text is to put a backslash.

So a text-var with this caption:
‘This is my text - Line 1\And this is Line 2’

Would show like this in a message-box:
This is my text - Line 1
And this is Line 2

Thanks a Lot. I got It…[Y]

Regards

Rose[:D]

Rose, please mark the message which provided a solution for your problem with a “Verify Solution”.

Ok…I am sorry i Didn’t know that…[:(]

No problem, just remember for future posts please.