Daemonblade777
Unregistered
Ok, well I'm having a issue. I haven't edited this code at all, and it's still giving me an error. lol
I'm getting the error message that says "Argument Is Not Optional". I've tried everything I could think of, but I just can't get this one.
Code: Call SendAddChar(frmNewChar.txtName, 0, frmNewChar.cmbClass.ListIndex, frmChars.lstChars.ListIndex + 1)
Tell me if you need more code that is around it.
So, that's the highlighed code?
Uh...
Gimme the SendAddChar sub, please.
Daemonblade777
Unregistered
Here is the entire thing. (I think this is what your wanted, right? o.O)
Code: Case MENU_STATE_ADDCHAR
frmNewChar.Visible = False
If ConnectToServer = True Then
Call SetStatus("Connected, sending character addition data...")
If frmNewChar.optMale.Value = True Then
Call SendAddChar(frmNewChar.txtName, 0, frmNewChar.cmbClass.ListIndex, frmChars.lstChars.ListIndex + 1)
Else
Call SendAddChar(frmNewChar.txtName, 1, frmNewChar.cmbClass.ListIndex, frmChars.lstChars.ListIndex + 1)
End If
End If
Thanks for helping me.
If it isn't the same as what Dave just posted, I'll have to take a closer look at home.
I'm somewhat, limited, since I'm in school ATM.
But, yeah, Dave, since you know what I'm talking about, do you think it's a problem with the sub?
If it's unchanged, Daemonblade777, then I can't see an immediate problem.
Daemonblade777
Unregistered
Actually, ya I did change that part that Dave posted. I'm trying to add Race and Alignment to my game...>.>
Code: Sub SendAddChar(ByVal Name As String, ByVal Sex As Long, ByVal ClassNum As Long, ByVal Slot As Long, ByVal Race As Long, ByVal Alignment As Long)
Dim Packet As String
Packet = "addchar" & SEP_CHAR & Trim(Name) & SEP_CHAR & Sex & SEP_CHAR & ClassNum & SEP_CHAR & Slot & SEP_CHAR & Race & SEP_CHAR & Alignment & SEP_CHAR & END_CHAR
Call SendData(Packet)
End Sub
Daemonblade777
Unregistered
I added the "ByVal Race As Long, ByVal Alignment As Long" part already, and it's still giving me the error...>.>
Add them to where you're calling the sub...
Yeah.
If you're trying to.. Let's say, send a Byte to a sub... But you use Long, it wont work.
Ex..
Code: Sub Hi(byval x as byte)
You can't use
Code: Dim g as Long
Call Hi(g)
That also causes the error...
Daemonblade777
Unregistered
Ok, well I fixed that...But now I'm getting a new error.
Code: Case MENU_STATE_ADDCHAR
frmNewChar.Visible = False
If ConnectToServer = True Then
Call SetStatus("Connected, sending character addition data...")
If frmNewChar.optMale.Value = True Then
Call SendAddChar(frmNewChar.txtName, 0, frmNewChar.cmbClass.ListIndex, frmChars.lstChars.ListIndex, frmNewChar.optBeast.ListIndex, frm.NewChar.optDark.ListIndex + 1)
Else
Call SendAddChar(frmNewChar.txtName, 1, frmNewChar.cmbClass.ListIndex, frmChars.lstChars.ListIndex + 1)
End If
End If
The part ".ListIndex" of the ".optBeast" part is the part I'm getting the error of "method or data member not found" on. I've never gotten this error before, so what do it even mean?
I don't think Option Buttons[radio buttons] have a listindex...
Try...
Code: Case MENU_STATE_ADDCHAR
frmNewChar.Visible = False
If ConnectToServer = True Then
Call SetStatus("Connected, sending character addition data...")
If frmNewChar.optMale.Value = True Then
If frmNewChar.optBeast.Value = True Then
Call SendAddChar(frmNewChar.txtName, 0, frmNewChar.cmbClass.ListIndex, frmChars.lstChars.ListIndex, 1, frm.NewChar.optDark.ListIndex + 1)
Else
Call SendAddChar(frmNewChar.txtName, 1, frmNewChar.cmbClass.ListIndex, 0, frmNewChar.optDark.ListIndex, frmChars.lstChars.ListIndex + 1)
End If
End If
Changes: Taking optBeast and making it affect the ByVal when called in SendAddChar, instead of trying to send something that doesn't exist.
I see frmChars.optDark.ListIndex. Either use real List Boxes, or make If Statements for every such condition. I'd recommend using List Boxes, but if you want to try an If Statement for EVERY possible combination, use Select Case instead. >.>
Daemonblade777
Unregistered
Now it gave me an error saying that "optBeast" is not defined. o.o I used your code.
frmNewChar.optBeast.Value
That's what I meant. frmNewChar. Rawr. >.>
Daemonblade777
Unregistered
Lol, ok. Thanks for helping me. I think I got it now. ^.^
No problem. =D Glad to help.
Anytime. :x
Daemonblade777
Unregistered
Sorry it took so long to respond.
But I learned. ^.^ I had to do something like this again, and I didn't have any problems doing it.
You've truly learned it when you can explain it to someone else and they can fully understand what you're talking about.
That being said, I must be a complete idiot. o.o;
Posts: 2,742
Threads: 115
Joined: Jun 2006
Reputation:
0
Aww thanks Dave. Love you too.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
If ignorance was bliss, then the world would be a better place than it is now.
Ignorance is bliss until you have to take care of yourself.
Remember that.
|