Qt Use Script object & function ?
-
wrote on 29 Apr 2020, 01:53 last edited by
I am using Qt 5.4.0.
Var ab = "test contents";
The file with the above contents was executed as a script.And delete Var ab = "test contents";
If you run the script after writing ab only, ab has test contents set.The function is the same.
function ab ()
{...
}Write it down, erase it after execution, and just execute ab () to execute it.
Is the variable name or function name stored somewhere? -
I am using Qt 5.4.0.
Var ab = "test contents";
The file with the above contents was executed as a script.And delete Var ab = "test contents";
If you run the script after writing ab only, ab has test contents set.The function is the same.
function ab ()
{...
}Write it down, erase it after execution, and just execute ab () to execute it.
Is the variable name or function name stored somewhere? -
wrote on 29 Apr 2020, 02:19 last edited by
-
wrote on 29 Apr 2020, 02:46 last edited by Pl45m4
@Pada_ said in Qt Use Script object & function ?:
ecmaScript
which is a form of Javascript :D
[edit: Actually the other way around: Javascript is an ECMAScript implementation... Thanks Wikipedia :-) ]Oh ok, wasn't aware that something like this even exists as Qt feature :)
Back to your problem:
Just a guess: I would say that your test string is still in your memory (stack) somewhere, so that your function can still access your test string. -
@Pada_ said in Qt Use Script object & function ?:
ecmaScript
which is a form of Javascript :D
[edit: Actually the other way around: Javascript is an ECMAScript implementation... Thanks Wikipedia :-) ]Oh ok, wasn't aware that something like this even exists as Qt feature :)
Back to your problem:
Just a guess: I would say that your test string is still in your memory (stack) somewhere, so that your function can still access your test string.wrote on 29 Apr 2020, 02:53 last edited by@Pl45m4 said in Qt Use Script object & function ?:
ecmaScript
Then, if you execute another script file inside the script, the function of the other script should be possible as the above problem, but the function of the other script is not executed.
1/5