Need some help

Discussion in 'Programming General' started by Cakey Bakey, Nov 20, 2010.

Need some help
  1. Unread #1 - Nov 20, 2010 at 3:00 AM
  2. Cakey Bakey
    Joined:
    Aug 5, 2009
    Posts:
    668
    Referrals:
    0
    Sythe Gold:
    0

    Cakey Bakey Apprentice
    Banned

    Need some help

    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.
     
  3. Unread #2 - Nov 20, 2010 at 4:49 AM
  4. Darthatron
    Joined:
    May 22, 2006
    Posts:
    1,612
    Referrals:
    3
    Sythe Gold:
    0

    Darthatron Massive Troll
    Retired Sectional Moderator Visual Basic Programmers

    Need some help

    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
     
  5. Unread #3 - Nov 20, 2010 at 8:00 AM
  6. Cakey Bakey
    Joined:
    Aug 5, 2009
    Posts:
    668
    Referrals:
    0
    Sythe Gold:
    0

    Cakey Bakey Apprentice
    Banned

    Need some help

    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 :)
     
  7. Unread #4 - Nov 23, 2010 at 12:31 AM
  8. Darthatron
    Joined:
    May 22, 2006
    Posts:
    1,612
    Referrals:
    3
    Sythe Gold:
    0

    Darthatron Massive Troll
    Retired Sectional Moderator Visual Basic Programmers

    Need some help

    No problems, I take it?
     
< Apple iPhone 4G 32GB .....................300£uro | PHP,MySQL,HTML,CSS Website Coder offer [paypal] >

Users viewing this thread
1 guest


 
 
Adblock breaks this site