Page 1 of 1

Switch Variables vs explicit methods

Posted: Fri Feb 06, 2015 1:47 am
by adthor
I'm just starting to get up to speed with Javascript in Switch. I've noticed that it's possible to get file statistics two different ways:



var jobStats = new FileStatistics(job.getPath());

var pageCount = jobStats.getNumber("NumberOfPages");



or



var pageCount = job.getVariableAsNumber("[Stats.NumberOfPages]");



Is there any meaningful difference between these methods (performance, side-effects, etc.)?



Thanks,



--arne

Switch Variables vs explicit methods

Posted: Fri Feb 06, 2015 1:58 pm
by freddyp
If you only need 1 piece of information: no difference. If you need several, it is best to use the FileStatistics class.



Freddy