Page 1 of 1

Concat Function

Posted: September 19th, 2017, 8:58 am
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

Re: Concat Function

Posted: September 25th, 2017, 8:52 am
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]));