|
Go
![]() |
New
![]() |
Find
![]() |
Notify
![]() |
Tools
![]() |
Reply
![]() |
|
|
Apprentice |
Haven't found this one in the docs or online yet. Is there a way to import modules/libraries in F-script? And specifically, within dlscriptd folders?
What I'd like to do is have some common code in a file that I can pop into each dlscriptd folder so I don't have to copy and paste it. |
||
|
|
Marketcircle Team |
Sure, you can load in a file like this...
Here's my file. ===== mystuff.fscript ===== BEGIN ===== addTwoNum := [ :a :b | a+b ]. multiplyTwoNum := [ :a :b | a*b ]. subtractTwoNum := [ :a :b | a-b ]. sayHello := [ :name | sys log:'Hello ' ++ name ]. ===== mystuff.fscript ===== END ===== now in a script, you can do... sys interpreter execute:(NSString stringWithContentsOfFile:'/Users/myUsername/Desktop/mystuff.fscript'). sayHello value:'Eric'. addTwoNum value:4 value:5. |
|||
|
|
Apprentice |
Thanks. This is helpful. I actually figured out something similar using object serialization but overlooked the interpreter message.
Since I use dlscriptd bundles, I have also been getting the bundle path using: (scriptPath stringByDeletingLastPathComponent) |
|||
|
| Previous Topic | Next Topic | powered by eve community |
| Please Wait. Your request is being processed... |
|

