what is the use of gs.include()?

shabbir5
Tera Guru

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

@Ankur Bawiskar Please provide your inputs and do the need full help

7 REPLIES 7

Madhuri Jagdeo
Tera Contributor

Hi @Shabbir ,

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 

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()??

John Zhang1
Kilo Patron
Kilo Patron

Please see the following example 

find_real_file.png