Close

CAS ActiveX Methods

The Close method frees all resources associated with a CAS instance.  If necessary, the Close method will also close any open session, and log off from the connection router.

void Close(
  LONG Instance // CAS instance to close
)


Parameters:
Instance CAS instance to close 

Return Values:
None

Example:
function LogOn()
 {
 var CAS_instance;

   // Get access to CAS interface and open an instance

 if (CAS = new ActiveXObject("CASX.CAS"))
   {  
   if (CAS_instance = CAS.Open(0,"",0)) 
     {
     var Tl, UniqueName, StatusNum;

       // Logon to the connection router
        
     Tl = CAS.New();
     CAS.AddTag(Tl,"LOGON","");
     UniqueName = "XYZ-"+parseInt(Math.random()*1000000+1000000);
     CAS.AddTag(Tl,"LOGON_NAME",UniqueName);
     CAS.AddTag(Tl,"DOMAIN_NAME","\\\\CASDEV\\NETSATISFAXTION");
     CAS.AddTag(Tl,"PROTOCOL",2); // IP

     Tl = CAS.Send(CAS_instance,Tl);
     StatusNum = parseInt(CAS.GetTag(Tl,"STATUS_NUM",0));
     CAS.Delete(Tl);
      
     if (StatusNum == 0)
       {
       return(CAS_instance);
       }
        
     CAS.Close(CAS_instance);
     }
    
   delete CAS;
   }

 return(null);
 }

See Also:
CAS Open, LOGOFF