writing multiple lines of script via message box
Posted: Wed Dec 31, 2014 10:58 pm
I'm just getting used to LiveCode. I love the possibility of fast live testing because instant feedback is a great way to learn.
From Python's IDLE, I'm really hooked on writing single lines but also multi-line functions using a command line interface.
Can I do the same with LiveCode? I know that the script editor is great and has debugging features, but hopefully you can indulge me as I ease my way into LiveCode. It's going to take a while before I get used to all of the floating toolbars. The more I can do with just the message box, the happier I'll be in the beginning!
Really specifically, because I'm just starting, I'm trying to create Hello World using just the message box.
Ideally, I could say:
"
Here's what actually works, as far as I can tell:
I can confirm I've done something via the message box by typing:
The line I'd want to write next is complicated by at least two things:
1) I don't know how, if it's possible, to indicate in the message box that I'd like "answer" to be at the start of a new line in the button's script. Putting the message box into multi-line mode and submitting on multiple lines didn't work. I think it didn't like my attempting to open the quotes on one line and close them on another. This forum post (http://forums.livecode.com/phpBB2/viewtopic.php?t=2767 ) gave me some slight hope that using HTML tags to indicate line breaks or paragraphs might work, but no luck. If there's a message box syntax for setting or adding to line 2 of the script, I don't know it.
2) I also wouldn't know how to do a quote within a quote, as would be necessary for "Hello World." Using a forward slash as an escape character didn't work.
Any help with the above would be appreciated.
Just to put everything in context, I assume it's not vital to be able to do all of this via the message box, and I'm looking forward to using the script editor more soon. I'm just at a phase now where I'm curious about how far I can go with the message box. Hopefully you'll indulge my curiosity!
From Python's IDLE, I'm really hooked on writing single lines but also multi-line functions using a command line interface.
Can I do the same with LiveCode? I know that the script editor is great and has debugging features, but hopefully you can indulge me as I ease my way into LiveCode. It's going to take a while before I get used to all of the floating toolbars. The more I can do with just the message box, the happier I'll be in the beginning!
Really specifically, because I'm just starting, I'm trying to create Hello World using just the message box.
Ideally, I could say:
Code: Select all
create button
set script of button 1 to
"
on mouseUp
[indent]answer /"Hello World/"[/indent]
[indent]end mouseUp[/indent]
Here's what actually works, as far as I can tell:
Code: Select all
create button
set script of button 1 to "on MouseUp"
Code: Select all
put line 1 of script of button 1
The line I'd want to write next is complicated by at least two things:
1) I don't know how, if it's possible, to indicate in the message box that I'd like "answer" to be at the start of a new line in the button's script. Putting the message box into multi-line mode and submitting on multiple lines didn't work. I think it didn't like my attempting to open the quotes on one line and close them on another. This forum post (http://forums.livecode.com/phpBB2/viewtopic.php?t=2767 ) gave me some slight hope that using HTML tags to indicate line breaks or paragraphs might work, but no luck. If there's a message box syntax for setting or adding to line 2 of the script, I don't know it.
2) I also wouldn't know how to do a quote within a quote, as would be necessary for "Hello World." Using a forward slash as an escape character didn't work.
Any help with the above would be appreciated.
Just to put everything in context, I assume it's not vital to be able to do all of this via the message box, and I'm looking forward to using the script editor more soon. I'm just at a phase now where I'm curious about how far I can go with the message box. Hopefully you'll indulge my curiosity!