![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
|
problem with my chat client
i am having trouble with my chat client it is coming up and saying unsupported variant type.
so here is my code i have. Private Sub bntSend_Click() On Error GoTo t sock1.SendData txtSend txtLog = txtLog & "Client : " & txtSend & vbCrLf Exit Sub t: MsgBox "Error : " & Err.Description sock1_Close End Sub that is the code that is causing the problem. it is the code that sends the text you typed to the other person and that is when the error comes up and when the error comes up it disconnects you from the server. when you open the client program the ip and port in there is the server i have for the program to run on or you could open the server program and use your computer as the server. and this is coded in visual basics 6 here is the download too for the server and client |
|
|
|
|
|
#2 |
|
Hobbyist Programmer
|
well i sat down and went through all my coding and it working now
here is the working version of my chat client/server |
|
|
|
|
|
#3 |
|
Hobbyist Programmer
|
my Suggestion, DO NOT USE GOTO statements. If you do I will make a program for you, that will be goto statement after goto statement, etc. They make your code look ugly. If you want to use error handling use exceptions, if you don't want to use exceptions then use if statements, just not goto statements. Help keep the world sane.
|
|
|
|
|
|
#4 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Goto statements, while not inherently evil, generally are a sign of a coder who has not mastered the simplicities of loops and branching constructs. While their equivalent (branches/jumps) are an integral part of assembly-language programming, you will find that they are often automatically provided by higher-level languages in the form of block delimiters (end statements, opening and closing parentheses, etc.).
The first line of attack is to realize that you're needlessly complicating matters and causing untold tons of grief to those who follow and maintain. None of that matters, of course, if you have no intention of being a pro or of disseminating your code, or of asking for help.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#5 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Unfortunately, using GoTo is basically the only way of handling errors in Visual Basic. My recommendation would be to switch to Visual Basic .NET (now Visual Basic 2005), but that requires a lot of hard work, especially if you need to port a program.
Out of curiosity, how did you fix the problem? |
|
|
|
|
|
#6 |
|
Hobbyist Programmer
|
the textbox on the program where you typed your stuff in before you hit the send button i forgot to rename the text box from
textbox1 to txtsend |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Networkprogramming in Unix | Xyhm | C | 2 | Mar 18th, 2006 1:35 PM |
| Problem with FTP server/client | Brent | C++ | 0 | Nov 25th, 2005 11:50 AM |
| invalid literal problem driving me nuts | cypherkronis | Python | 5 | Jul 3rd, 2005 1:03 PM |
| Try capturing client text crashed!? | Kam | C++ | 0 | May 19th, 2005 1:31 AM |
| Freezing Applets | Mjordan2nd | Java | 6 | Apr 13th, 2005 5:07 AM |