Old 06-08-2019, 04:56 AM   #1
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 2,533
Default Lua Assert/Load analog in EEL2 (JSFX)?

Is there a way to execute string as code, like this?

Code:
string = strcpy(#,'function(x) return x*2 end');
new_function = assert(string);
out_val = new_function(2);
> 4
__________________
SoundCloud | MPL Scripts discussion | ReaPack | Donate
mpl is offline   Reply With Quote
Old 06-08-2019, 12:33 PM   #2
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 7,956
Default

Quote:
Originally Posted by mpl View Post
Is there a way to execute string as code, like this?
Eel ReaScript has :

Code:
EEL: eval("code")

Executes code passed in. Code can use functions, but functions created in code can't be used elsewhere.
But I don't think that's available for JSFX.
__________________
For info on SWS Reaper extension plugin (including Xenakios' previous extension/actions) :
http://www.sws-extension.org/
https://github.com/Jeff0S/sws
--
Xenakios blog (about HourGlass, Paul(X)Stretch and λ) :
http://xenakios.wordpress.com/
Xenakios is online now   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 03:04 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.