Can livecode run code presented in a text field.
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Can livecode run code presented in a text field.
Assuming the text in a textbox was perfectly correct code, identical to the way it is presented in the editor, is there any way to run it?
An example of that process might be an exe built in LC that generates correct code in a field to run as part of the exe. The code would be generated as a result of different inputs to questions or outcomes.
An example of that process might be an exe built in LC that generates correct code in a field to run as part of the exe. The code would be generated as a result of different inputs to questions or outcomes.
-
- VIP Livecode Opensource Backer
- Posts: 256
- Joined: Sun May 27, 2007 8:19 pm
Re: Can livecode run code presented in a text field.
Use the 'do' command
do field "Statements"
There is a limit of the number of lines you can run in this way. I think it is 10.
Martin
do field "Statements"
There is a limit of the number of lines you can run in this way. I think it is 10.
Martin
-
- VIP Livecode Opensource Backer
- Posts: 256
- Joined: Sun May 27, 2007 8:19 pm
Re: Can livecode run code presented in a text field.
I just looked up scriptlimits in the dictionary to see what the limits are.
So it looks like you may not be limited if the scripts were typed in a field.When using a standalone application, an object's script property may not be set to a string containing more than ten statements. This limit is set by line 1 of the scriptLimits function. (This does not limit scripts that are already written: standalone applications can run scripts of any length.
-
- VIP Livecode Opensource Backer
- Posts: 184
- Joined: Wed Apr 10, 2013 5:09 pm
Re: Can livecode run code presented in a text field.
While you may be limited to 10 lines of code in the commercial edition of LiveCode, there is no limit in the Community Edition.
If you are using the Commercial Edition, then contact RunRev, as they sometimes allow applications with the "do" command, but on a case by case basis.
Andrew
If you are using the Commercial Edition, then contact RunRev, as they sometimes allow applications with the "do" command, but on a case by case basis.
Andrew
Re: Can livecode run code presented in a text field.
I believe the limitation is in the engine, and the scriptlimits aren't checked until the engine tries to compile the code. That means the 10-line limit will be enforced with the "do" command as well as when setting an actual script. But as Andrew said, it doesn't apply to the community version.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- VIP Livecode Opensource Backer
- Posts: 184
- Joined: Wed Apr 10, 2013 5:09 pm
Re: Can livecode run code presented in a text field.
Hi,
There is also the "debugDo" command, but I never understood what it did.
Anyone out there know how it works?
Andrew
There is also the "debugDo" command, but I never understood what it did.
Anyone out there know how it works?
Andrew