Concatenate String in loop.. SOLVED
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Concatenate String in loop.. SOLVED
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
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
Last edited by snop21 on Fri Feb 21, 2014 7:54 pm, edited 1 time in total.
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: Concatenate String in loop..
To me this looks like only the comma is replaced with space?my query (ken1,ken2,ken3,ken4,ken5)
holder = ken1 ken2 ken3 ken4 ken5
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Concatenate String in loop..
Hi Simon,
I attached the file. So that you can view it in actual if you have time..
Thanks
-snop21
I attached the file. So that you can view it in actual if you have time..
Thanks
-snop21
- Attachments
-
- QueryMoBilePick.livecode.zip
- (5.57 KiB) Downloaded 260 times
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: Concatenate String in loop..
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
Did you want to tell me?
Look, I'm happy to help but I'm not your code debugger.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Concatenate String in loop..
Hi,
In the dictionary, check and read about:
param, params, paramCount
HTH,
Thierry
In the dictionary, check and read about:
param, params, paramCount
HTH,
Thierry
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!
Re: Concatenate String in loop..
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
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..
Simon,
Sorry. Thank you for the help..
Thierry,
Thanks. Will read it. )
Klaus,
Roger that.. ) And Sorry..)
Regards
-snop21
Sorry. Thank you for the help..
Thierry,
Thanks. Will read it. )
Klaus,
Roger that.. ) And Sorry..)
Regards
-snop21
-
- VIP Livecode Opensource Backer
- Posts: 9665
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Concatenate String in loop..
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
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..
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
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
- Attachments
-
- QueryMoBilePick.livecode.zip
- (5.57 KiB) Downloaded 242 times
Re: Concatenate String in loop..
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..
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...
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..
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
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