Help "With Clause" with port find
Help "With Clause" with port find
Help "With Clause" with port find
Help "With Clause" with port find
Help "With Clause" with port find
Help "With Clause" with port find Help "With Clause" with port find Help "With Clause" with port find Help "With Clause" with port find Help "With Clause" with port find Help "With Clause" with port find Help "With Clause" with port find Help "With Clause" with port find
Help "With Clause" with port find Help "With Clause" with port find
Help "With Clause" with port find
Go Back  Xtreme Visual Basic Talk > > > Help "With Clause" with port find


Reply
 
Thread Tools Display Modes
  #1  
Old 05-12-2003, 10:08 AM
2bNvUs's Avatar
2bNvUs 2bNvUs is offline
Centurion
 
Join Date: Apr 2003
Location: Birmingham, AL
Posts: 165
Question Help "With Clause" with port find


I am getting a compile error when I try to run a simple app for finding a modem and getting its speed. The error reads "End With without With" but I have a with. Below is the code. Can someone let me know what is going wrong?

Private Function FindModem(BitRate As Long) As Integer
Dim I As Integer
Dim PortNum As Integer
Dim ErrCode
With Comm1
If .PortOpen = True Then
.PortOpen = False
BitRate = 1200
.RTSEnable = True
.Settings = Format$(BitRate) & ",n,8,1"

On Error Resume Next
For I = 1 To 16
.CommPort = I
.PortOpen = True
If .PortOpen Then
ErrCode = ModemCommand("ATV1Q0", 1)
If ErrCode = OK Then
PortNum = I
Exit For
Else
Comm1.PortOpen = False
End If
End If
Next I
If PortNum > 0 Then
BitRate = 115200
Do
Comm1.Settings = Format$(BitRate) & ",n,8,1"
ErrCode = ModemCommand("AT", 1)
If ErrCode = OK Then Exit Do
BitRate = BitRate \ 2
If BitRate = 28800 Then BitRate = 38400
Loop Until BitRate = 1200
FindModem = PortNum
End If
End With

End Function
Reply With Quote
  #2  
Old 05-12-2003, 10:14 AM
GMan_NC's Avatar
GMan_NCHelp "With Clause" with port find GMan_NC is offline
Proud Daddy

Forum Leader
* Expert *
 
Join Date: Sep 2002
Location: North Carolina, USA
Posts: 1,962
Default

It's actually one of your If statements that is missing and End If.

Try indenting your code to see where the problem is.
__________________
A morning without coffee is like something without something else.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to find an available local TCP port? jbarry1234 Communications 2 03-15-2003 01:31 PM
Another Printer Port Question chris00 Communications 3 01-23-2003 01:41 PM
Trouble with port controlling SSR rack btlfts General 2 05-17-2002 12:15 PM
how can i open a port and leave open rudy Communications 1 12-11-2000 08:26 AM
Listen to a open port, found a vb Ip port blocker visualbasic700e General 3 12-04-2000 08:45 AM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Help "With Clause" with port find
Help "With Clause" with port find
Help "With Clause" with port find Help "With Clause" with port find
Help "With Clause" with port find
Help "With Clause" with port find
Help "With Clause" with port find Help "With Clause" with port find Help "With Clause" with port find Help "With Clause" with port find Help "With Clause" with port find Help "With Clause" with port find Help "With Clause" with port find
Help "With Clause" with port find
Help "With Clause" with port find
 
Help "With Clause" with port find
Help "With Clause" with port find
 
-->