replaceText problem
Kay C Lan
lan.kc.macmail at gmail.com
Sun Jan 4 20:03:03 EST 2015
On Mon, Jan 5, 2015 at 4:25 AM, Peter Haworth <pete at lcsql.com> wrote:
>
> Back on the need for a put or a get with a function, it's interesting to
> note that you don't have to do that in the message box. Executing -
> replaceText("abc","c","z") - in the message box puts "abz" into the message
> box result area.
>
Hi Peter,
Ah, the rest of my rant! I'm am certain that this must be the two most
frustrating, confusing and time consuming mistakes that newbies make with
LC. I'm constantly Cutting and Pasting code from websites, pdf manuals,
this List, and other people's stacks. Only in LC is it possible to Cut a
code example from the Dictionary, Paste it into a script and get an error.
Then Paste it into the Message Box and have it work perfectly. Paste it
back into a script and it doesn't work.
Whilst I now appreciate the convenience of not having to type the 'put' or
'into ...' when testing code in the MB, if I ran the world, ALL Dictionary
examples would have to be syntax correct, thereby allowing direct Cut and
Paste into any script, AND there would be a Preference check box "Require
'put' and 'into ...' in Message Box" which upon initial installation of LC
would be defaulted as Ticked so that newbies would get a consistent result
between code in their scripts and in the MB. OR, automatically corrected
the syntax in the MB to reflect the need of 'put' and 'into ...'
I readily admit my coding toolbox is extremely small, but LC is the only
one whose official Docs present me with code examples that works in one
location but doesn't in another. I don't find it interesting, I find it
confusing. I dare suggest that the whole time spent on this thread may have
been saved if the replaceText example in the Dictionary worked as a
straight Copy and Paste and your own troubleshooting significantly less if
the MB behaved consistently and identically to code from your script.
More information about the use-livecode
mailing list