how can run a LC script code in my standalone APP
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
how can run a LC script code in my standalone APP
Hello everyone:
Just for education purpose, I want to develop an APP which can run a piece of LC script code and output the results, such as in the main window, the user types some LC code and press one button labeled with "Running ", then output the results. Thanks!
Just for education purpose, I want to develop an APP which can run a piece of LC script code and output the results, such as in the main window, the user types some LC code and press one button labeled with "Running ", then output the results. Thanks!
Re: how can run a LC script code in my standalone APP
Code: Select all
put field "codeSnippet" into codeSnippet
-- SANITISE THE CODE SNIPPET
-- check for bad code, whether accidental or deliberate
-- then once you have code that is safe to run,
do tCodeSnippet
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: how can run a LC script code in my standalone APP
Hi longzexd,
The idea is attractive but you have to consider you will lost edit tools (indentation for loop, search tools ...)
Just a thought
Best regards
Jean-Marc
The idea is attractive but you have to consider you will lost edit tools (indentation for loop, search tools ...)
Just a thought
Best regards
Jean-Marc
https://alternatic.ch
Re: how can run a LC script code in my standalone APP
Thanks a lot !
SparkOut wrote: ↑Wed Nov 14, 2018 5:13 pmCode: Select all
put field "codeSnippet" into codeSnippet -- SANITISE THE CODE SNIPPET -- check for bad code, whether accidental or deliberate -- then once you have code that is safe to run, do tCodeSnippet
Re: how can run a LC script code in my standalone APP
yes, it will lost some edit tools functions, however I just want the user to master some basic LC script grammar. Thanks!
Re: how can run a LC script code in my standalone APP
It seems to that some basic automatic indentation would be important for new students getting used to Livecode. And, with the naviety of someone who hasn't actually tried it, it seems that it shouldn't be that hard to implement.
E.g. watch for some basic keywords like on, function, if, repeat, etc., and on the return key being pressed, add an additional amount of indentation to the current indentaion until the keyword "end" is encountered.
It might even be possible to code for automaically adding the "end" line below the "on" line, but, in this case, one would have to use a different way to determine if a line should be indented, perhaps using flags.
It may also be that someone in this group has already written similar code. It might be worth searching around a bit for it.
E.g. watch for some basic keywords like on, function, if, repeat, etc., and on the return key being pressed, add an additional amount of indentation to the current indentaion until the keyword "end" is encountered.
It might even be possible to code for automaically adding the "end" line below the "on" line, but, in this case, one would have to use a different way to determine if a line should be indented, perhaps using flags.
It may also be that someone in this group has already written similar code. It might be worth searching around a bit for it.
Re: how can run a LC script code in my standalone APP
Erm, isn't what your describing what the code editor already does? Or am I missing something (again)
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: how can run a LC script code in my standalone APP
@ longzexd
Just for my curiosity, why do you want use a standalone instead a simple stack ?
Just for my curiosity, why do you want use a standalone instead a simple stack ?
https://alternatic.ch