If,Else, Elseif,

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

  1. abobakrwaheed74

    abobakrwaheed74 Member

    Joined:
    Jun 14, 2013
    Messages:
    77
    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 the best

    Joined:
    Feb 14, 2015
    Messages:
    1,726
    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:
    local var = 4
    
    if (var == 3) then
        -- start body
        print('var is equal to 3')
        -- end body
    elseif (var == 4) then
        -- start body
        print('var is equal to 4')
        -- end body
    else
        -- start body
        print('var is not equal to 3 or 4)
        -- end body
    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:
    7
    your first print is incorrect
     
  4. Xeraphus

    Xeraphus the best

    Joined:
    Feb 14, 2015
    Messages:
    1,726
    oops
     
    Nivo likes this.
  5. abobakrwaheed74

    abobakrwaheed74 Member

    Joined:
    Jun 14, 2013
    Messages:
    77
    Thankss ;D , can I contact you privately, do you have skype or discord?!
     

Share This Page