PDA

View Full Version : Solved: Trying to code a queue manager



goatc0re
06-17-2013, 10:32 AM
In the following code, "InstanceNum" is an integer that I need to rotate (1,2,3,4,5,6, back to 1). This code is for a queue manager that will receive tcpip messages and distribute them to queues for various instances of a script to scoop up. I've tried Dim'ing InstanceNum and manipulating in various locations in the code but the problem is regardless of where I put it, "InstanceNum" is always empty when p_data is triggered. Any help would be appreciated, hope everyone's having a great Monday! One last note: this is being written within Boston Workstation.


Public WithEvents p As CWinSock

Sub cmdShutdown_Click()
End
End Sub
Sub p_Data(sData As String, Index As Integer)

txtMsg.Text = txtMsg.Text & vbCrLf & Index & ": " & sData
FSO = CreateObject("Scripting.FileSystemObject")
Set oFile = FSO.CreateTextFile("Y:\New\" & "instance" & InstanceNum & "\" & Format(CStr(Now), "yyy_mm_dd_hh_mm_ss") & ".txt")
oFile.WriteLine sData
oFile.Close

End Sub
Sub Start()
Set p = New CWinSock
Me.Caption = "Waiting for msgs on port: 40000"
p.Listen (40000)
Me.Show
End Sub

goatc0re
06-20-2013, 11:38 AM
We figured it out, thanks anyway.