and1_hotsauce
Registered User.
- Local time
- Yesterday, 16:50
- Joined
- Aug 29, 2011
- Messages
- 17
Hi,
I am having trouble understanding how the below function (processmessage) works. The program (activexperts) automatically stores a received sms into a database called 'Message' database. The code below retrieves this message FROM message database
But how can a variable be used without first declaring the variable? That is, numMessageID has not been declared. There has been no call made to this function. It stands alone.
I am having trouble understanding how the below function (processmessage) works. The program (activexperts) automatically stores a received sms into a database called 'Message' database. The code below retrieves this message FROM message database
But how can a variable be used without first declaring the variable? That is, numMessageID has not been declared. There has been no call made to this function. It stands alone.
Code:
[FONT=Courier New][COLOR=#0000ff]Function[/COLOR][COLOR=#000000] ProcessMessage[/COLOR][COLOR=#000000]( numMessageID[/COLOR][COLOR=#000000] )[/COLOR]
[COLOR=#000000] [/COLOR][COLOR=#0000ff]Dim[/COLOR][COLOR=#000000] objMessageIn[/COLOR][COLOR=#000000], objMessageOut[/COLOR]
[COLOR=#000000] [/COLOR][COLOR=#008000]' Open the Message Database[/COLOR]
[COLOR=#000000] g_objMessageDB.Open[/COLOR]
[COLOR=#000000] [/COLOR]
[COLOR=#000000] [/COLOR][COLOR=#008000]' Retrieve the message that has just been received. [/COLOR]
[COLOR=#000000] [/COLOR][COLOR=#0000ff]Set[/COLOR][COLOR=#000000] objMessageIn[/COLOR][COLOR=#000000] = g_objMessageDB.FindFirstMessage[/COLOR][COLOR=#000000] ( [/COLOR][COLOR=#808080]"ID = "[/COLOR][COLOR=#000000] & numMessageID[/COLOR][COLOR=#000000] ) [/COLOR]
[COLOR=#000000] [/COLOR][COLOR=#008000]' Change Status to from Pending to Success. If you don't do it, the message will be processed by subsequent triggers (if defined) because message is still pending[/COLOR]
[COLOR=#000000] objMessageIn.Status[/COLOR][COLOR=#000000] = g_objConstants.MESSAGESTATUS_SUCCESS[/COLOR]
[COLOR=#000000] g_objMessageDB.Save[/COLOR][COLOR=#000000] objMessageIn[/COLOR][COLOR=#000000] [/COLOR]
[COLOR=#000000] [/COLOR]
[COLOR=#000000] [/COLOR][COLOR=#008000]' Call ProcessQuery function with input argument objMessageIn where objMessageIn is the sms that was received. [/COLOR]
[COLOR=#000000] ProcessQuery[/COLOR][COLOR=#000000] ( objMessageIn[/COLOR][COLOR=#000000] )[/COLOR]
[COLOR=#000000] [/COLOR]
[COLOR=#000000] [/COLOR][COLOR=#008000]' Close the Message Database[/COLOR]
[COLOR=#000000] g_objMessageDB.Close[/COLOR]
[COLOR=#000000] [/COLOR]
[COLOR=#0000ff]End[/COLOR][COLOR=#000000] [/COLOR][COLOR=#0000ff]Function[/COLOR]
[/FONT]