Code: Select all
on mouseUp pMouseButton
answer "My name is " & the name of me
create button "Btn01" in card id 1002
set the loc of btn "Btn01" to 200,80
create button "Btn02" in card 1 of this stack
set the loc of btn "Btn02" to 200,115
put "on mouseUP " & cr into tscript
put tscript & "put " & quote & "Hello World from " & quote & " & the name of me" & " into tmsg" & cr into tscript
put tscript & "answer " & tmsg & cr into tscript
put tscript & "end mouseUp" & cr into tscript
set the script of button "Btn01" to tscript
set the script of button "Btn02" to tscript
set the disabled of me to true
end mouseUp
I'm not sure why Livecode allows this. The second surprise is that MacOS does not throw a fit when a running application is modified in this way.
Now the down side is that getting all the quotes in the right places is extremely error prone but it seems that a simple script runner interface could be built this way. It would mean that the built app could in effect be modified at anytime in the future just by editing the UI description file.
Is anyone else surprised ?
S