Count Property

Description:

The Count property returns the number of messages in the Inbox collection object.

   

Usage intCount = ObjectName.Inbox.Count
Value Type Integer
Access Mode Read Only
Remarks
  • The Count property value is refreshed whenever the Inbox Refresh method is called or a message is deleted from the Inbox.
  • After calling the Delete method, the Count property value reduces, and the Index of the remaining messages (after the Index of the deleted message) are reduced by 1.
  • All the Index values 'may change' if Inbox Refresh method is called immediately after Delete method is completed.
  • The property HasMessages is and extended version of the Count property.

Usage Example:

Visual Basic / ASP (VBScript)
Dim objSMS As mCore.SMS
Set objSMS = New mCore.SMS
' You can also use Set objSMS = CreateObject("mCore.SMS")
' In case of ASP (VBScript) to create object use
' Set objSMS = Server.CreateObject("mCore.SMS")
' In ASP use Response.Write instead of MsgBox
objSMS.Port = "COM3"
objSMS.BaudRate = 19200
objSMS.Parity = "N"
objSMS.DataBits = 8
objSMS.StopBits = "1"
' It is not necessary to execute the 'Connect' method.
' Connection state is detected internally by mCore and
' the 'Connect' method is executed accordingly.
objSMS.PIN = "1234"
objSMS.MessageMemory = "ME"
objSMS.Inbox.Concatenate = True
If objSMS.Inbox.Refresh Then
     If objSMS.Inbox.HasMessages Then
          MsgBox "Total " & objSMS.Inbox.Count & " messages."
          For i = 1 To objSMS.Inbox.Count
               MsgBox "From: " & objSMS.Inbox.Message(i).Phone _
                & VbCrLf & "Message: " & objSMS.Inbox.Message(i).Text
          Next
     End If
End If
' Disconnect method is executed internally
' whenever the SMS object is terminated.
Set objSMS = Nothing

  

Copyright © IG Logix Softech Pvt Ltd, All Rights Reserved