How to output calculated value to txt

Post Reply
RBJ
Newbie
Posts: 2
Joined: Mon Jul 11, 2011 1:19 pm

How to output calculated value to txt

Post by RBJ »

Hello



I have this javascript that I want to output the calculated value to a txt file.



I just do not what to do, I've tried several times with "XSLT transforms", but without any success.



Are there any who can help me?







var theDataset = job.getDataset( "Xml" );

var Stans = theDataset.evalToString( "/Order/Stans" );

var Quantity = theDataset.evalToString( "/Order/Quantity" );



var stansValue = 0;



var ekstraAntal = 0;



var antalSider = 0;

var result = 0;

{

switch (Stans) {







case "001D":

stansValue =2;

break;



case "002D":

stansValue =2;

break;





default:



stansValue;



}









switch (stansValue) {



case 1:



ekstraAntal = 10;



break;



case 2:



ekstraAntal = 6;



break;



default:



ekstraAntal = 4;



}





if (Quantity < 1) {



Quantity = 1;

}







result = result + 1;



result = Quantity / stansValue;



result = result * 1.025;

result = Math.ceil(result);







antalSider = result + ekstraAntal;

}

antalSider;
















Post Reply