How to set interval in javascript

How to set interval in OLE to monthly and weekly? It seems that setting interval to 2592000 only to make the interval 30D but not monthly. I try Interval=inMonthly but it seems not work on js. I try googling it but no luck so far.

AB = new ActiveXObject( "Broker.Application" ); // creates AmiBroker object

try
{
    AB.ActiveDocument.Interval=2592000;
    AW = AB.ActiveWindow;
}
catch ( err )
{
     WScript.echo( "Exception: " + err.message ); // display error that may occur
}

Thanks in advance.

inMonthly is an AFL variable but not a jscript one.
inMonthly is interval constant returning 2160001.
See here:

So if you insert that number in jscript then it should set to monthly in AB.

// Incomplete jscript snippet
//....
var inMonthly = 2160001;
AB.ActiveDocument.Interval=inMonthly;// set monthly interval
//....

Weekly

// Incomplete jscript snippet
//....
 var inWeekly = 432001;
 AB.ActiveDocument.Interval=inWeekly;// set weekly interval
//....

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.