AddTag

CAS ActiveX Methods

The AddTag method adds a tag and tag data to the end of a taglist.  The tag and data are appended to the end of the internal taglist buffer.  The taglist buffer is not freed until the taglist is deleted with the Delete method.  To add a tag to a section within a taglist, you must first call CreateSection to create a section taglist, and then pass the section taglist to AddTag.

LONG AddTag(
  LONG TagList, // Taglist to add tag and data to
  BSTR TagName, // Name of tag to add
  BSTR TagData // Tag data to add
)


Parameters:
TagList Taglist to receive the new tag

TagName Name of tag to be added

TagData Tag data to be added

Return Values:
ID of added tag.

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

       // Send taglist to CAS driver, to logon to domain

     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 New, CAS Delete, CAS CreateSection, CAS GetTag