Results 1 to 2 of 2

Thread: Double Brackets

  1. #1
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts

    Double Brackets

    Hello again

    Quick question - what are the double brackets for?

    PHP Code:
    if(menu == game["menu_weapon_allies"] || menu == game["menu_weapon_axis"])
            {
                
    self closeMenu();
                
    self closeInGameMenu();
                
    self [[level.weapon]](response);
            } 

    Thanks in advance.



    Editted:
    I just found this in the gametype script:
    in main()
    Code:
    	level.weapon = ::menuWeapon;
    And the function:
    Code:
    menuWeapon(response)
    I guess I answered my own question... is it some kind of alias for the function?
    Last edited by guiismiti; 10th October 2015 at 18:02.
    set logfile 2

  2. #2
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Yes, you are correct.

    PHP Code:
    foo()
    {
        
    bar = ::foobar;
        [[
    bar]]();
    }

    foobar()
    {
        
    iprintln("hello");

    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  3. The Following 3 Users Say Thank You to IzNoGoD For This Useful Post:

    guiismiti (10th October 2015),kung foo man (11th October 2015),maxdamage99 (10th October 2015)

Tags for this Thread

Posting Permissions

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