ActiveMISC     More ActiveX Products... Site Home

ActiveMISC --- TextMap Interface


Methods
Sample Usage: Create 100 Unique 5-digits Random Numbers

Screenshot

var ac=new ActiveXObject("ActiveMISC.Console");
var map=new ActiveXObject("ActiveMISC.TextMap");
ac.Print("Create 100 Unique Random Numbers.\n");
while(map.GetSize()<100)
    {
    var r=parseInt(Math.random() * 100000);
    var rs=r.toString();
    if(rs.length!=5)
        continue;
    if(!map.KeyExist(rs))
        map.Set(rs, "");
    }
var ary=map.CreateTextArray("");
var n=ary.GetSize();
ac.Print("Here is the " + n.toString() + " random numbers:\n");
for(var i=0; i<; i++)
    {
    var s=ary.GetAt(i);
    ac.Print(s);
    ac.Print("\n");
    }