what is the use of gs.include()?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-15-2021 06:28 AM
Hi All,
what is the use of gs.include();
i got to know it is used to call a sript include , but to call a script include we can use new scriptincludename().functionname() rite ?
may i know the exact use case ?
for example i have the below script include
var testAOP = Class.create();
testAOP.prototype = {
initialize: function() {
},
sum:function()
{
var a=10;
var b=20;
var c=a+b;
return c;
},
type: 'testAOP'
};
so if i call this into a background script using gs.inlude('testAOP') i am getting out put as "true" , can anyone tell me the exact difference
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-15-2021 06:49 AM
Hi
gs.include() allows you to call a script include and use the functions in that script include within your current script include i.e you do not have to copy the functions into your current script include, but rather you can call them directly.
You can write gs.include('testAOP');
Regards,
Madhuri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-15-2021 07:01 AM
Hi Madhuri , suppose if i have f1,f2,f3,f4 4 functions inside script include , if i want to use only f3 in another script include then how i need to call using gs.include() ? what is the best practice to call a script include into another script include? gs.include or new scriptinclide().functionname()??

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-15-2021 08:36 AM