Switch Variables vs explicit methods

Post Reply
adthor
Newbie
Posts: 1
Joined: Wed Jan 21, 2015 7:49 pm

Switch Variables vs explicit methods

Post 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
freddyp
Advanced member
Posts: 413
Joined: Thu Feb 09, 2012 3:53 pm

Switch Variables vs explicit methods

Post 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
Post Reply