Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Concatenate strings in memo other than by + 1

Status
Not open for further replies.

MerryMadDad

Programmer
Dec 11, 2001
47
GB
I want to join a number of strings together on a Single line in a memo to make four to six rows (lines) and the number of different strings to join can be one to thirty-two. for example :

First row s1a, s2a, s3a, ......sa32a
Second row s1b, s2b, s3b, .... s32b
third row ....
fourth row ....
..
..

all the strings are held in an array and I have a counter to indicate how many there are in each row (all rows will have the same ammount)

What I've done


for row:= 0 to (rowpoint) do
SaveMemo.lines.Add (Names[(col),row] +', ' + Names[(col+1) .. and so on ....

The above works for the rows Ok but I'd like some means of getting the columns added other than by + so that I can use a pointer in a loop.

Any help gratefully received
Thank you

 
Well there is a concat function
e.g s := concat(s1,s2,s3);

Dont know if this will help you ?

Why do you wnat to use pointers ?
This isn't 'C' you know :)

Steve
 
Thanks for you posting.
Didn't know there was such a function as concat, I may be able to use it in conjuction with the stuff I've done already.

I need to use a pointer because the number of items added to the string (line) varies between 1 to 32 after the intial first string.
Also the number of rows can vary from 4 to 6. In the example above col is set to 1.

 
How about something like this? Still using add, but with a loop...

for row:= 0 to (rowpoint) do
begin
for col:= 0 to colcount do
temp := temp + +', ' + Names[col,row];
savememo.lines.add(temp);
temp := '';
end;

Good luck!
TealWren
 
Hello Tealwren, Thank you for your posting, I have used your suggestion and it works great !
so my question si answered fully.
Thanks again

MerryMadDad :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top