Clear Method

Description:

The Clear method of Inbox collection object deletes all the previously retrieved messages in the Inbox and also from the GSM modem.

   

Usage blnResult = ObjectName.Inbox.Clear
Parameters None
Returns Boolean value
  • True - If the clearing of Inbox was succesfull
  • False - If there was a error in deleting at least one message
Remarks The Clear method deletes only those messages from the GSM modem which have been retrieved by the previous Refresh method call.

Usage Example:

Visual Basic / ASP (VBScript)
Dim objSMS As mCore.SMS, i As Integer, Message As Message
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 = "COM2"
objSMS.BaudRate = 57600
objSMS.Parity = "N"
objSMS.DataBits = 8
objSMS.StopBits = "1"
objSMS.Inbox.Concatenate = True
objSMS.MessageMemory = "SM"
objSMS.Inbox.Refresh
If Not objSMS.IsError(True, "My Application") Then
     MsgBox "Total " & objSMS.Inbox.Count & " incoming messages!"
     For Each Message In objSMS.Inbox
          MsgBox objSMS.Inbox(i).TimeStampRFC &  vbCrLf & "From: " _
           & objSMS.Inbox(i).Phone & vbCrLf & objSMS.Inbox(i).Text
     Next
     objSMS.Inbox.Clear
     MsgBox "Total " & objSMS.Inbox.Count & " messages in Inbox!"
End If
Set objSMS = Nothing

  

Copyright © IG Logix Softech Pvt Ltd, All Rights Reserved