VB help

Discussion about hacker.org's server
Post Reply
Liidian
Posts: 202
Joined: Fri Jun 05, 2009 10:49 pm
Location: Guess

VB help

Post by Liidian »

Why doesn't this work?.

Private Sub Text1_Change()
IF (Message153.text = "Lol") THEN
MsgBox "Wow"
ElSEIF (Message153.text = "wow")
MsgBox "lol"
END IF
END Sub
The whole "system" is a number of people creating a code all together, this code loops and is there for a "system".
System Zero could also be confirmed with one word "Hacker's"
plope0726
Posts: 826
Joined: Mon Dec 15, 2008 10:13 pm

Re: VB help

Post by plope0726 »

Liidian wrote:Why doesn't this work?.

Private Sub Text1_Change()
IF (Message153.text = "Lol") THEN
MsgBox "Wow"
ElSEIF (Message153.text = "wow")
MsgBox "lol"
END IF
END Sub
is this the entire code? If so then you haven't declared the variable Message153.text. You need to give the variable a value before you can run a test on it like this. Try adding "Dim Message153.text as string = "Lol" before the If statement. And I may be wrong but i think you need to type MessageBox.show() not MsgBox

Private Sub Text1_Change()

Dim Message153.text as string = "Lol"

IF (Message153.text = "Lol") THEN
MessageBox.show("Wow")
ElSEIF (Message153.text = "wow")
MessageBox.show("lol")
END IF
END Sub
Liidian
Posts: 202
Joined: Fri Jun 05, 2009 10:49 pm
Location: Guess

Re: VB help

Post by Liidian »

plope0726 wrote:
Liidian wrote:Why doesn't this work?.

Private Sub Text1_Change()
IF (Message153.text = "Lol") THEN
MsgBox "Wow"
ElSEIF (Message153.text = "wow")
MsgBox "lol"
END IF
END Sub
is this the entire code? If so then you haven't declared the variable Message153.text. You need to give the variable a value before you can run a test on it like this. Try adding "Dim Message153.text as string = "Lol" before the If statement. And I may be wrong but i think you need to type MessageBox.show() not MsgBox

Private Sub Text1_Change()

Dim Message153.text as string = "Lol"

IF (Message153.text = "Lol") THEN
MessageBox.show("Wow")
ElSEIF (Message153.text = "wow")
MessageBox.show("lol")
END IF
END Sub
KK Thanks ^^
The whole "system" is a number of people creating a code all together, this code loops and is there for a "system".
System Zero could also be confirmed with one word "Hacker's"
User avatar
PaRaDoX
Posts: 708
Joined: Fri Aug 22, 2008 5:52 am
Location: In your fridge, waiting to pop out and scare you.

Post by PaRaDoX »

Don't you need to start (and end) a class as well? (Or something to that effect, trying to remember)
Image

~You are a glitch in my reasoning.
plope0726
Posts: 826
Joined: Mon Dec 15, 2008 10:13 pm

Post by plope0726 »

yeah but I think that in VB the private sub / end sub is the start and end of the class.
User avatar
PaRaDoX
Posts: 708
Joined: Fri Aug 22, 2008 5:52 am
Location: In your fridge, waiting to pop out and scare you.

Post by PaRaDoX »

Although its kinda 'cheating', you can try running that in VBExpress, it should tell you whats wrong with it.
Image

~You are a glitch in my reasoning.
Post Reply