• Log in or sign up for an account here: https://www.sythe.org/login

Need some help

Cakey Bakey

Apprentice

Banned
Joined
Aug 5, 2009
Sythe Gold
0
Messages
668
Hi , I was just wondering if somebody could give me some advice on how to make a simple 'IF' statement , and for it to work properly.
The statement can be about absolutely ANYTHING.
I'm an ametaur at programming , and fortunately , my course only has a small amount of programming in it.

I'd probably learn better if somebody good on Visual Basic on these forums could break it down for me and give me an example or point to point instructions , as aposed to me researching it.

Thanks.
 
Assuming you understand Variables, and other basics...

Code:
Dim bBoolean As Boolean    'This can be anything
bBoolean = True            'Sets the value of bBoolean to 'True'
[B]If[/B] bBoolean = True [B]Then[/B]    'Checks if bBoolean is 'True', and shows the "IT WORKED!" message box if it is.
    MsgBox "IT WORKED!"
Else                       'Otherwise it shows the "IT FAILED!" message box.
    MsgBox "IT FAILED!"
End If

Also, you don't NEED an Else term:
Code:
Dim bBoolean As Boolean
bBoolean = True
[B]If[/B] bBoolean = True [B]Then[/B]
    MsgBox "IT WORKED!"
End If
 
Thanks for your reply Darth :)
Gonna have a play around and see what I can do. I'll let you know if I have any problems :)
 
Runescape Gamblingrunescape gambling
Back
Top