is it possible to have a file with all of my "functions" that I want to call from my application and then have it included in my app, so I can just have a simple call in my process. something like EXEC_SCRIPT MyScript.myFunction(parameters)
Thanks
Bruce
Can I have EXEC_SCRIPT call a function instead of String?
Re: Can I have EXEC_SCRIPT call a function instead of String
+1BLOMASKY wrote:is it possible to have a file with all of my "functions" that I want to call from my application and then have it included in my app, so I can just have a simple call in my process. something like EXEC_SCRIPT MyScript.myFunction(parameters)
Thanks
Bruce
-
- Posts: 7525
- Joined: Sun Apr 24, 2005 12:36 am
- Contact:
Re: Can I have EXEC_SCRIPT call a function instead of String
Well, you can create your own Javascript file with your functions and put the file into Custom/JS directory from where it will be automatically loaded when your app starts up.
Aware IM Support Team
Re: Can I have EXEC_SCRIPT call a function instead of String
OK, so assume I do create a file. How do I reference the name of my function?
Do I need to put my functions in a class?
Any samples?
Thanks
Bruce
Do I need to put my functions in a class?
Any samples?
Thanks
Bruce
-
- Posts: 7525
- Joined: Sun Apr 24, 2005 12:36 am
- Contact:
Re: Can I have EXEC_SCRIPT call a function instead of String
You don't need classes. You can just call it like this:
EXEC_SCRIPT 'myFunction(parameters)'
Just make sure that the name myFunction is globally unique. A good idea is to have a special prefix unique to you/your company:
EXEC_SCRIPT 'bl_myFunction (parameters)'
EXEC_SCRIPT 'myFunction(parameters)'
Just make sure that the name myFunction is globally unique. A good idea is to have a special prefix unique to you/your company:
EXEC_SCRIPT 'bl_myFunction (parameters)'
Aware IM Support Team
-
- Posts: 7525
- Joined: Sun Apr 24, 2005 12:36 am
- Contact:
Re: Can I have EXEC_SCRIPT call a function instead of String
and in your Javascript file you will define it like this:
function bl_myFunction (parameters)
{
alert ("Function is running!!!");
}
function bl_myFunction (parameters)
{
alert ("Function is running!!!");
}
Aware IM Support Team
Re: Can I have EXEC_SCRIPT call a function instead of String
i am having a lot of trouble with this rule.
my js content located in Custom/JS
here is what i tried:
error Exception running script ReferenceError: LbasedURL is not defined
function run OK with the parameter value= /LbasedURL/
error Exception running script SyntaxError: invalid regular expression flag v
how can i pass this parameter "/val/val/file.pdf"
my js content located in Custom/JS
Code: Select all
function LopenBrowser(LbasedURL) {
alert(LbasedURL);
}
Code: Select all
EXEC_SCRIPT 'LopenBrowser(LbasedURL)'
Code: Select all
EXEC_SCRIPT 'LopenBrowser(/LbasedURL/)'
Code: Select all
EXEC_SCRIPT 'LopenBrowser(/val/val/file.pdf)'
how can i pass this parameter "/val/val/file.pdf"
-
- Posts: 7525
- Joined: Sun Apr 24, 2005 12:36 am
- Contact:
Re: Can I have EXEC_SCRIPT call a function instead of String
Why don't you do something like this:
EXEC_SCRIPT 'var param1=...; param2=...; LopenBrowser(param1,param2)'
EXEC_SCRIPT 'var param1=...; param2=...; LopenBrowser(param1,param2)'
Aware IM Support Team
Re: Can I have EXEC_SCRIPT call a function instead of String
it's a single parameter function.aware_support wrote:Why don't you do something like this:
EXEC_SCRIPT 'var param1=...; param2=...; LopenBrowser(param1,param2)'
for now i have divided the string to multiple parameters and join them with JS