Page 1 of 1
How to add a "" in a string. String Manipulation Help.
Posted: Fri Feb 21, 2014 4:49 am
by snop21
guys,
I already solved my problem on displaying the data from my query and display it to the dialog box one at a time..

)
-----> Credit to Klaus and FabricioRocha
But now my problem is how to put a quote on each result before and after the string.. it looks like this.. ---> Date ------> "Date"
Thank you guys
-snop21
Re: How to add a "" in a string. String Manipulation Help.
Posted: Fri Feb 21, 2014 4:56 am
by Simon
quote&Date"e
Re: How to add a "" in a string. String Manipulation Help.
Posted: Fri Feb 21, 2014 5:34 am
by snop21
Simon,
Thank you..

)
I have followup question How can I put the result into a variable. I can't explain it. I will just put sample here
I have records for sample
ken1
ken2
ken3
ken4
ken5
i will make a loop for this to display is into dialogbox one at a time -------> which i got it already.
My question is how can I put this into a variable? looks like this
-------------> holder = "ken1" "ken2" "ken3" "ken4" "ken5" <--------------------
Thanks Simon
-snop21
Re: How to add a "" in a string. String Manipulation Help.
Posted: Fri Feb 21, 2014 5:48 am
by snop21
I want to came up like this
--------------------------------------------------
put "Head" & cr & "Member" into optionList
--------------------------------------------------
which I can use it into the mobilepick
But I want data in my option came from my database that's why I am trying to have string manipulation to be able to have this.
Thanks guys.
-snop21
Re: How to add a "" in a string. String Manipulation Help.
Posted: Fri Feb 21, 2014 6:29 am
by Simon
Hi snop21,
I'm not sure if you have answered this or are you asking another question?
and

- 2014-02-20_2126.png (6.55 KiB) Viewed 5235 times
is this what you are calling a dialogbox? If it is we call it an Answer box or Answer dialog, please use these terms as it makes it easier to understand the questions.
Simon
Re: How to add a "" in a string. String Manipulation Help.
Posted: Fri Feb 21, 2014 7:50 am
by snop21
Simon,
o0o0o0o0ps... I am very sorry.. yes, that's what I am referring to. Answer Dialog.
-Regards
-snop21
Re: How to add a "" in a string. String Manipulation Help.
Posted: Fri Feb 21, 2014 2:16 pm
by Klaus
Hi snop21,
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?
Explain what you want to do to yourself and you will surely
be able to translate it to "Livecode"!
Best
Klaus
P.S.
Looking at your last postings, I think you need some hints concerning repeat loops!
1. repeat with...
Code: Select all
...
repeat with i = 1 to the num of lines of fld XYZ
## do something with line i of fld XYZ
## LC does the counting for you when using "repeat with ..."
## So this is completely unneccessary:
## add 1 to i
end repeat
...
2. repeat for each line/item etc... tLine in tList
Here LC will NOT count the lines, that's why this is so fast, so If you need to "track" the linenumber
you need to add a counter and raise it in every loop
This loop is READ ONLY, means you CANNOT modify tLine in the loop!
Code: Select all
...
set itemdel to TAB
## Optional:
put 1 into tCounter
repeat for each line tLine in tList
## BAD, will give HIGHLY UNEXSPECTED RESULTS:
## put 22 into item 1 of tLine
## Do this -> use a variable with the content of tLine and modify that instead:
put tLine into tLine2
put 22 into item 1 of tLine2
put tLine2 & CR after tNewList
## Optional
add 1 to tCounter
end repeat
...