If,Else, Elseif,

Discussion in 'Programming & Scripting' started by abobakrwaheed74, Dec 23, 2016.

  1. abobakrwaheed74

    abobakrwaheed74 Member

    Joined:
    Jun 14, 2013
    Messages:
    129
    Likes Received:
    8
    Best Answers:
    0
    If you have any problem with understanding if,else,elseif, you should try to work on scratch, it's really simpe, drag and drop the codes
    Link: scratch.mit.edu
     
    Xeraphus likes this.
  2. Xeraphus

    Xeraphus Premium User Premium User

    Joined:
    Feb 14, 2015
    Messages:
    2,405
    Likes Received:
    971
    Best Answers:
    103
    if you use proper tabbing in your code you can visualize in a way like that website does
    you can easily read bodies of blocks and know what bodies belong to what blocks
    such as this
    Code (Text):
    1.  
    2. local var = 4
    3.  
    4. if (var == 3) then
    5.     -- start body
    6.     print('var is equal to 3')
    7.     -- end body
    8. elseif (var == 4) then
    9.     -- start body
    10.     print('var is equal to 4')
    11.     -- end body
    12. else
    13.     -- start body
    14.     print('var is not equal to 3 or 4)
    15.     -- end body
    16. end
    i'm not saying this website is bad though ;)
     
    Last edited: Dec 23, 2016
  3. Nivo

    Nivo New Member

    Joined:
    Aug 19, 2013
    Messages:
    17
    Likes Received:
    1
    Best Answers:
    0
    your first print is incorrect
     
  4. Xeraphus

    Xeraphus Premium User Premium User

    Joined:
    Feb 14, 2015
    Messages:
    2,405
    Likes Received:
    971
    Best Answers:
    103
    oops
     
    Nivo likes this.
  5. abobakrwaheed74

    abobakrwaheed74 Member

    Joined:
    Jun 14, 2013
    Messages:
    129
    Likes Received:
    8
    Best Answers:
    0
    Thankss ;D , can I contact you privately, do you have skype or discord?!
     

Share This Page

Loading...