The Delete method deletes the message (pointed by the message Index) from the Inbox as well as the Modem.
| Usage |
|
| Parameters | Index - The Index of the message to be deleted |
| Returns |
Boolean value
|
| Remarks |
|
| Visual Basic / ASP (VBScript) |
| Dim objSMS As mCore.SMS, i As Integer 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) And objSMS.Inbox.HasMessages Then MsgBox "Total " & objSMS.Inbox.Count & " incoming messages!" ' The following code deletes the 1st to 3rd message in Inbox For i = objSMS.Inbox.Count to 1 Step -1 MsgBox objSMS.Inbox.Message(i).TimeStampRFC & vbCrLf _ & "From: " & objSMS.Inbox.Message(i).Phone & vbCrLf _ & objSMS.Inbox.Message(i).Text If i <= 3 Then objSMS.Inbox.Message(i).Delete End If Next ' The next few lines of code deletes all the messages in ' the Inbox (Same result as Clear method of Inbox ' e.g. objSMS.Inbox.Clear) For i = objSMS.Inbox.Count To 1 Step -1 objSMS.Inbox(i).Delete Next MsgBox "Total " & objSMS.Inbox.Count & " messages!" End If Set objSMS = Nothing |