-
-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Execute function instead of whole script #319
Comments
I think there are other ways to solve this issue. For example, first run in the script with all the functions, then can run a script with just the wanted function. Could also look into using modules. |
I'm not sure I understand. I can run a whole script, but how would I then run the wanted function only? Modules look basically like classes to me. Unless I can interact with them from outside Anko, I'm not sure that modules would help me. |
Split the script into two part. First run in the part with all the functions. Then run a script with just the function you want to call. |
Are the variables shared between the two parts? Basically I have a function (or in this case script) that gets called in regular intervals and with each execution of the script, all variables are reset. My thought was that if I just call a function and not the whole script, I can have variables outside of that function that don't reset between calls. |
Any script can be run in any env, the env is where the script runs. Can keep running scripts as long as you want in the same env.
Output:
|
Okay, that solves this issue. Thanks! |
Is it possible to execute a specific function in a script instead of the entire script? Something like
vm.ExecuteFunction
with the name of the function as a parameter would be nice.The text was updated successfully, but these errors were encountered: