Page 1 of 1
[Code Help] put return
Posted: Fri Dec 21, 2012 2:51 am
by shawnblc
I have a scrolling list field that I'm trying to add companies to. I'd like to be able to add a few.
Code: Select all
on mouseUp
ask question "What company would you like to add?"
put it into vCompany
put vCompany into field fldCompany
else
put return vCompany after field fldCompany
end mouseUp
Re: [Code Help] put return
Posted: Fri Dec 21, 2012 3:38 am
by dunbarx
Hi.
You are on your way, but are stumbling because the seemingly natural english-like language still needs to have a formal syntax, and rules that, though loose, are still, in fact, rather strict.
The idea you have is sound, to a point. But you must play around quite a bit, and read the dictionary constantly. What you want to do is to place your new data into the line that is one below however many you already have, correct? Think about these two possibilities:
1: put return & yourNewData after field "yourField"
2- put yourNewData into line (the number of lines of fld "yourField") + 1 of fld "yourField"
See how each of these does the same thing? Each has its own methodology, and might be useful in different circumstances. Your original places the new text "into" the field, and this will replace all original contents. Remember that practice and reading thing.
On another note, you cannot have an "else" keyword outside of an "if/then" construction. Did I mention more play and practice?
Write back often.
Craig Newman
Re: [Code Help] put return
Posted: Fri Dec 21, 2012 4:11 am
by shawnblc
Thanks for the help Craig. Eventually, this noobie will understand this LC programming
