Results 1 to 5 of 5

Thread: Using local with 2 or more variables?

  1. #1
    iBot User
    Join Date
    Sep 2012
    Posts
    239
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    46 Post(s)
    Reputation
    23
    Rep Power
    5

    Using local with 2 or more variables?

    I want to use one "local" to set many variables(?). I don't like using many lines. Example:

    PHP Code:
    local bbb "lel" ccc "lol" 
    Instead of:

    PHP Code:
    local bbb "lel"
    local ccc "lol" 
    Is it possible?

  2. #2
    Premium User Eldar's Avatar
    Join Date
    Apr 2013
    Location
    Poland
    Posts
    1,335
    Mentioned
    37 Post(s)
    Tagged
    2 Thread(s)
    Quoted
    62 Post(s)
    Reputation
    159
    Rep Power
    7
    Lua Code:
    local bbb, ccc = "lel","lol"

  3. #3
    Normal User
    Join Date
    Jun 2012
    Location
    Sweden
    Posts
    1,671
    Mentioned
    18 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    8 Post(s)
    Reputation
    132
    Rep Power
    9
    PHP Code:
    local bbbccc "lel""lol" 
    Edit; damn you faster eldar :]

  4. #4
    iBot User
    Join Date
    Sep 2012
    Posts
    239
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    46 Post(s)
    Reputation
    23
    Rep Power
    5
    Thanks guys.

  5. #5
    iBot User pink_panther's Avatar
    Join Date
    May 2012
    Location
    Australia
    Posts
    4,075
    Mentioned
    49 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    178 Post(s)
    Reputation
    309
    Rep Power
    10
    Adding unrelated variables on separate lines makes it easier to read and debug

    Having it on separate lines also doesn't make it run any slower.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •