deathman5
asked on
Three Questions
1)can anybody give me a code on using MSComm1 to call a telephone number, for now I have this:
Private Sub Form_Load()
MSComm1.PortOpen = True
MSComm1.Output = ("AT DT 000000")
End Sub
but it never do anything, I did put the correct Comm Port, and it works in Phone Dialer but not in VB...
2) I need a way to check if connection to the net is established, I need it to work in any case, (when a PC is recieving connection from another computer through LAN NETWORK, I need the program to know that their is connection)
thx
3)
SELECT CASE QUESTION
I have more than 25 IF...THEN statments and I want to make then Select Case but the problem is the statments are
If Left$(text1.text, 3) = "msg" then
msgbox "message!"
end if
if left$(text1.text,4)="help" then
msgbox "help"
end if
...
so Select case isnt working :(
I thought of something similar to this:
x = Len(CASES)
Select Case Left$(Text1.Text, x)
Case "msg"
MsgBox "MESSAGE!"
Case "help"
MsgBox "HELP!"
End Select
but there is nothing called Len(CASES)
any help?
Private Sub Form_Load()
MSComm1.PortOpen = True
MSComm1.Output = ("AT DT 000000")
End Sub
but it never do anything, I did put the correct Comm Port, and it works in Phone Dialer but not in VB...
2) I need a way to check if connection to the net is established, I need it to work in any case, (when a PC is recieving connection from another computer through LAN NETWORK, I need the program to know that their is connection)
thx
3)
SELECT CASE QUESTION
I have more than 25 IF...THEN statments and I want to make then Select Case but the problem is the statments are
If Left$(text1.text, 3) = "msg" then
msgbox "message!"
end if
if left$(text1.text,4)="help"
msgbox "help"
end if
...
so Select case isnt working :(
I thought of something similar to this:
x = Len(CASES)
Select Case Left$(Text1.Text, x)
Case "msg"
MsgBox "MESSAGE!"
Case "help"
MsgBox "HELP!"
End Select
but there is nothing called Len(CASES)
any help?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
@mlmcc
nop not that, that will get len of all text I need the len of the cases...
thx anyway
@MaxPol
yup it worked, I have another question that I'll post about it, hope u read it!
nop not that, that will get len of all text I need the len of the cases...
thx anyway
@MaxPol
yup it worked, I have another question that I'll post about it, hope u read it!
x = LenB(Text1.Text)
or this should work
Select Case Text1.Text
or if not are the first 3 characters different for each case
Select Case Left$(Text1.Text, 3)
mlmcc