Concat Function

Discussions about CSEntry
Forum rules
New release: CSPro 8.0
Post Reply
Mutanen Lau
Posts: 22
Joined: November 8th, 2016, 10:48 am

Concat Function

Post by Mutanen Lau »

Dear Users,
Kindly study the following chink of codes:

Code: Select all

	string choices = "ABCDZ";
	numeric i;
	
	do i = 1 while i<=5;
		if pos(choices[i:1],strip($)) <> 0 then
			LIST_OF_SERVICES = Concat(LIST_OF_SERVICES," ",getlabel($,choices[i:1]));
		endif
	enddo;
i want to join the list of services as selected by the user from a checkbox in to a single field LIST_OF_SERVICES
but to my surprise it is returning an empty string even if selection were made.
please how can i get around this
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Concat Function

Post by Gregory Martin »

If LIST_OF_SERVICES is a dictionary item, then you need to strip it when creating your string, as it will always be padded with spaces to match the length in the dictionary.
LIST_OF_SERVICES = Concat(strip(LIST_OF_SERVICES)," ",getlabel($,choices[i:1]));
Post Reply