Page 1 of 1
					
				Concatenate String in loop.. SOLVED
				Posted: Fri Feb 21, 2014 9:10 am
				by snop21
				Good Day Livecoders,
I will just ask how can I concatenate the result of my loop which is string to the previous result.? 
Here's the Idea
I have data from my query (ken1,ken2,ken3,ken4,ken5)
in my loop
I will display it one at a time but I want to put the result into a variable which will be concatenated with the next result.
Here's will look like
     Repeat ------- (don't know how to do it exactly so it let's assume this is the loop  

) I have a variable called holder
         holder = ken1 ken2 ken3 ken4 ken5 <=========== This is I want to get.  Need your help guys.. ! 

)
     end repeat
     any help will be very much appreciated..
 Regards
-snop21
 
			
					
				Re: Concatenate String in loop..
				Posted: Fri Feb 21, 2014 9:28 am
				by Simon
				my query (ken1,ken2,ken3,ken4,ken5)
holder = ken1 ken2 ken3 ken4 ken5 
To me this looks like only the comma is replaced with space?
 
			
					
				Re: Concatenate String in loop..
				Posted: Fri Feb 21, 2014 9:52 am
				by snop21
				Hi Simon,
I attached the file. So that you can view it in actual if you have time.. 
Thanks
-snop21
			 
			
					
				Re: Concatenate String in loop..
				Posted: Fri Feb 21, 2014 10:02 am
				by Simon
				While a stack is great, I'm not going to review your code to find where the problem is.
Did you want to tell me?
Look, I'm happy to help but I'm not your code debugger.
Simon
			 
			
					
				Re: Concatenate String in loop..
				Posted: Fri Feb 21, 2014 10:16 am
				by Thierry
				Hi,
In the dictionary, check and read about:
   param, params, paramCount
HTH,
Thierry
			 
			
					
				Re: Concatenate String in loop..
				Posted: Fri Feb 21, 2014 2:38 pm
				by Klaus
				Hi snop21,
hm, you already asked this in another thread  
 
 
And since this is definitively NOT a Windows specific problem,
I will move this thread to the "Beginner" section.
Best
Klaus
 
			
					
				Re: Concatenate String in loop..
				Posted: Fri Feb 21, 2014 3:57 pm
				by snop21
				Simon,
Sorry. Thank you for the help..
 
 
Thierry,
Thanks. Will read it. 

)
Klaus,
Roger that.. 

) And Sorry..

)
Regards
-snop21
 
			
					
				Re: Concatenate String in loop..
				Posted: Fri Feb 21, 2014 4:15 pm
				by dunbarx
				Hi.
Not sure where your problem lies. Is it in how to concatenate?  Are you comfortable with creating the repeat loop you need?
If concatenation, are you aware of, for example:
put "abc" after "xyz"  (to give "abcxyz")
put "abc" & comma & "xyz" (to give "abc,xyz")
put "abc" & space & "xyz" (to give "abc xyz")
Write back...
Craig Newman
			 
			
					
				Re: Concatenate String in loop..
				Posted: Fri Feb 21, 2014 5:08 pm
				by snop21
				Hi dunbarx,
Here's my problem.. 
 
I have a data from my database I want to display it using mobilepick, so for me to do that I have to make it like this
==>  put "Head" & cr & "Member" into optionList <===================================================================================||
                                                                                                                                                                                                                            ||
My plan is I want to display the data from my query into answer dialog 1st to check if I got it right.. ---> Which I got this right.! Very lucky..! 

)         ||
                                                                                                                                                                                                                             ||
2nd is since I was able to get the data from my database and display it one at a time I want it to form it like What I wrote above ================= ||
So that I can use it for mobilepick.. Hope I explain it clearly.. 

) Will attached again the file for you to see it. if you don't mind.. If you just have a time..
Thank you very much..
Regards
-snop21
 
			
					
				Re: Concatenate String in loop..
				Posted: Fri Feb 21, 2014 5:19 pm
				by Klaus
				To quote myself from THE OTHER THREAD:
...
really not sure what your problem is:
Adding QUOTE to every line of your variable?
Turning a CR delimited list into a SPACE delimited list?
...
 
 
			
					
				Re: Concatenate String in loop..
				Posted: Fri Feb 21, 2014 5:35 pm
				by Klaus
				After a couple of thoughts, the problem may not be one 
 
 
1. "mobilepick" requires at least one parameter -> a CR delimited list
2. The query "select whatever from any_table" will return, you guessed, a CR delimited list of all columns whatever in table any_table! 
 
 
That means you can use the variable returned form the database query in your "mobilepick" handler 
without any modification like adding QUOTES!
But maybe I still don't get your problem...
 
			
					
				Re: Concatenate String in loop..
				Posted: Fri Feb 21, 2014 7:51 pm
				by snop21
				Klaus,
You are right klaus.. I dont really need that quote stuffs... I am so stupid.. 

( I am making things so complicated even supposedly it's not.. 

( 
Thank you klaus..
For this for sure I am going to be better to this PL..! 

)
Thank You, Guys.. 

)
-snop21