setBatchMode in macros using other functions


#1

Hi everyone,

I have a small question about setBatchMode.

If I have a script that use several custom function, is the use of setBatchMode(true) in the main macro applied to the used function?

For instance something like (no sense macro, it is just to explain what I mean):

var something;
var something1;
var something2;
setBatchMode(true);

add_1(something);
add_2(something);

setBatchMode(false);
//end macro

//functions below
function add_1(something){
 something = something + something1;
}

function add_2(something){
 something = something + something2;
}

Should I apply setBatchMode(true) at the beginning of the 2 functions or not?

Thanks

Regards

Fabien


#2

Fabien,

why don’t you try yourself?

In general you should enclose the main part of your code and please avoid global variables wherever possible.

Regards

Herbie


#3

[EDIT due to misunderstanding]


#4

Fabien,

there is a slight misunderstanding:

I didn’t want to see your code!

In general you should enclose the main part of your code

by setBatchMode(true) and setBatchMode(false).

This was my recommendation.

Regards

Herbie


#5

Herbie,

Sorry for this misunderstanding and for my answer! As you can imagine, English is not my native language.

Thx a lot for your answer!

Regards

Fabien