Mirage Source http://www.miragesource.net/forums/ |
|
I'm Confused o.o http://www.miragesource.net/forums/viewtopic.php?f=201&t=3276 |
Page 1 of 2 |
Author: | Daemonblade777 [ Tue Jan 15, 2008 12:56 am ] |
Post subject: | I'm Confused o.o |
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. |
Author: | Matt2 [ Tue Jan 15, 2008 1:27 am ] |
Post subject: | Re: I'm Confused o.o |
So, that's the highlighed code? Uh... Gimme the SendAddChar sub, please. |
Author: | Daemonblade777 [ Tue Jan 15, 2008 7:03 am ] |
Post subject: | Re: I'm Confused o.o |
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. |
Author: | Lea [ Tue Jan 15, 2008 1:22 pm ] |
Post subject: | Re: I'm Confused o.o |
He meant this code: Code: Sub SendAddChar(ByVal Name As String, ByVal Sex As Long, ByVal ClassNum As Long, ByVal Slot As Long) Dim Packet As String Packet = "addchar" & SEP_CHAR & Trim(Name) & SEP_CHAR & Sex & SEP_CHAR & ClassNum & SEP_CHAR & Slot & SEP_CHAR & END_CHAR Call SendData(Packet) End Sub Is it the same as this? |
Author: | Matt2 [ Tue Jan 15, 2008 1:30 pm ] |
Post subject: | Re: I'm Confused o.o |
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. |
Author: | Lea [ Tue Jan 15, 2008 2:58 pm ] |
Post subject: | Re: I'm Confused o.o |
Probably, yes. |
Author: | Daemonblade777 [ Tue Jan 15, 2008 8:11 pm ] |
Post subject: | Re: I'm Confused o.o |
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 |
Author: | Lea [ Tue Jan 15, 2008 9:03 pm ] |
Post subject: | Re: I'm Confused o.o |
Isn't the problem glaringly apparent then? Compare: Code: Sub SendAddChar(ByVal Name As String, ByVal Sex As Long, ByVal ClassNum As Long, ByVal Slot As Long) 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) You're missing two arguments. |
Author: | Daemonblade777 [ Tue Jan 15, 2008 9:09 pm ] |
Post subject: | Re: I'm Confused o.o |
I added the "ByVal Race As Long, ByVal Alignment As Long" part already, and it's still giving me the error...>.> |
Author: | Matt2 [ Tue Jan 15, 2008 10:15 pm ] |
Post subject: | Re: I'm Confused o.o |
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... |
Author: | Daemonblade777 [ Tue Jan 15, 2008 10:42 pm ] |
Post subject: | Re: I'm Confused o.o |
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? |
Author: | Matt2 [ Tue Jan 15, 2008 10:49 pm ] |
Post subject: | Re: I'm Confused o.o |
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. >.> |
Author: | Daemonblade777 [ Tue Jan 15, 2008 10:54 pm ] |
Post subject: | Re: I'm Confused o.o |
Now it gave me an error saying that "optBeast" is not defined. o.o I used your code. |
Author: | Matt2 [ Tue Jan 15, 2008 11:05 pm ] |
Post subject: | Re: I'm Confused o.o |
frmNewChar.optBeast.Value That's what I meant. frmNewChar. Rawr. >.> |
Author: | Daemonblade777 [ Tue Jan 15, 2008 11:12 pm ] |
Post subject: | Re: I'm Confused o.o |
Lol, ok. Thanks for helping me. I think I got it now. ^.^ |
Author: | Matt2 [ Tue Jan 15, 2008 11:14 pm ] |
Post subject: | Re: I'm Confused o.o |
No problem. =D Glad to help. Anytime. |
Author: | Lea [ Wed Jan 16, 2008 3:42 am ] |
Post subject: | Re: I'm Confused o.o |
Now the important part, did you learn? Or did you just, "use your code" |
Author: | Daemonblade777 [ Mon Jan 21, 2008 8:04 pm ] |
Post subject: | Re: I'm Confused o.o |
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. |
Author: | Kousaten [ Tue Jan 29, 2008 1:14 pm ] |
Post subject: | Re: I'm Confused o.o |
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; |
Author: | Lea [ Tue Jan 29, 2008 2:22 pm ] |
Post subject: | Re: I'm Confused o.o |
I think everyone's a complete idiot. Except for Robin and I! |
Author: | Robin [ Tue Jan 29, 2008 4:38 pm ] |
Post subject: | Re: I'm Confused o.o |
Aww thanks Dave. Love you too. |
Author: | Kousaten [ Tue Jan 29, 2008 5:52 pm ] |
Post subject: | Re: I'm Confused o.o |
If ignorance was bliss, then the world would be a better place than it is now. |
Author: | Matt2 [ Wed Jan 30, 2008 12:16 am ] |
Post subject: | Re: I'm Confused o.o |
Ignorance is bliss until you have to take care of yourself. Remember that. |
Page 1 of 2 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |