ok i'm trying to make it display a splash screen when i start a bot but i'm stummped at the part of the code which says Compile Error: Variable Not Defined.
-> Private Sub form_load() (Highlighted yellow)
Dim y As String, c As String
On Error GoTo error
Label1.ForeColor = &H8000000D
y = Dir$(App.Path & "\config.ini")
If y = "" Then
Exit Sub
End If
c = ReadINI("Main", "ShowSplash", "config.ini")
If c = "Y" Then
Close #1
Exit Sub
Else
Close #1
frmChat.Show
Unload Me
End If
error:
Close #1
End Sub
Someone help me thanks
well first of all, don't ever type out the function name for an event; use the drop down boxes at the top
Where did you steal that code from?
I didn't even read it, but I mean, I'm pretty sure you stole that from somewhere. And if you did and put it in your bot, it's likely it won't work because it requires a different module/form from the project.
Private Sub form_load()
Dim y As String, c As String
On Error GoTo error
Label1.ForeColor = &H8000000D
y = Dir$(App.Path & "\config.ini")
If y = "" Then
Exit Sub
End If
c = ReadINI("Main", "ShowSplash", "config.ini")
If c = "Y" Then
Close #1
Exit Sub
Else
Close #1
frmChat.Show
Unload Me
End If
error:
Close #1
End Sub
that is the
'StealthBot 11/5/02
'Source Code Version: 1.1.4
that stealth released
/me adds Dayclone to THE LIST.
Since nobody else mentioned it, that's really crappy VB code. Just a little unconstructive criticism. :)
Just out of curiosity, does VB give horrendously ambiguous error messages or are people just not smart enough to interpret them?
i.e. MSVC will say something like "undeclared identifier 'blah'" if you have a variable that was never created. Does VB honestly say "Variable not defined" and then not tell you what variable it's talking about?!
Quote from: Zakath on April 09, 2003, 10:39 AMDoes VB honestly say "Variable not defined" and then not tell you what variable it's talking about?!
Don't know about VB, but on RB 4.5, it does almost exactly that... "Undefined identifier", and then points to the erroneous line. Very confusing if you have 2 undefined identifiers on the same line, makes you think the fix you added didn't work!
Quote from: Zakath on April 09, 2003, 10:39 AM
Just out of curiosity, does VB give horrendously ambiguous error messages or are people just not smart enough to interpret them?
i.e. MSVC will say something like "undeclared identifier 'blah'" if you have a variable that was never created. Does VB honestly say "Variable not defined" and then not tell you what variable it's talking about?!
The error is "Variable Not Defined" and the variable is highlighted. Not the whole line, just the variable you forgot to define. Kinda hard to not figure that out.
Quote from: Grok on April 09, 2003, 06:51 AM
Since nobody else mentioned it, that's really crappy VB code. Just a little unconstructive criticism. :)
Yeah it is. I wrote that most likely right around the time when I learned how to make my own functions. I've had to re-code probably 2/3 of StealthBot to mesh with new, more efficient, easier-to-read ways of writing code I've learned in the last 3-4 months.. It's been fun.
As it's written today:
Private Sub Form_Load()
Me.Icon = frmChat.Icon
If Dir$(App.Path & "\config.ini") = "" Then Exit Sub
If ReadINI("Main", "ShowSplash", "config.ini") <> "Y" Then
frmChat.Show
Unload Me
End If
End Sub