Post by Riktronics on Mar 5, 2004 21:57:12 GMT -5
And I don't know what I am doing, but if someone could take pity on me and clue me in, I would be so grateful. I have been working all night on trying to make the BBS server give an 'OK' to my modem init strings. If I put my code in the MSComm1_OnComm() section, and then connect to the server via telnet, then the MSComm1_OnComm() section is active, and it answers all my init strings and the BBS boots. Of course that's not where I want it, I want it to run when the server starts. I can't for the life of me (and the life of my two VB 6 manuals) figure out what causes MSComm1_OnComm() to run when telnet is active. There doesn't seem to be a statement that calls that sub.
Here is the code I am putting in (if I could get it to run where I want):
Received = MSComm1.Input
AddMessage Received
If Left$(Received, 4) = "X1M0" Then
MSComm1.Output = "OK"
AddMessage "ok"
End If
If Left$(Received, 8) = "=27S7=25" Then
MSComm1.Output = "OK"
AddMessage "ok"
End If
The strings are short because (I'm assuming) that since the flow control is set to 8 there it gives the first 8 characters in one line in one 'MSComm1.Input' and the rest of the characters in the next one. I'm checking for the end of the string because that seemed to make more sense, although it seemed to work if I checked on the first 8 and then said OK...
I'm sure that all 8 or 9 people that are in this forum are all rolling thier eyes right now, I apologize for my show of ignorance of everything that is VB and serial communications.
Here is the code I am putting in (if I could get it to run where I want):
Received = MSComm1.Input
AddMessage Received
If Left$(Received, 4) = "X1M0" Then
MSComm1.Output = "OK"
AddMessage "ok"
End If
If Left$(Received, 8) = "=27S7=25" Then
MSComm1.Output = "OK"
AddMessage "ok"
End If
The strings are short because (I'm assuming) that since the flow control is set to 8 there it gives the first 8 characters in one line in one 'MSComm1.Input' and the rest of the characters in the next one. I'm checking for the end of the string because that seemed to make more sense, although it seemed to work if I checked on the first 8 and then said OK...
I'm sure that all 8 or 9 people that are in this forum are all rolling thier eyes right now, I apologize for my show of ignorance of everything that is VB and serial communications.