How do i set a global variable?

Discussion in 'Mac Programming' started by Intelligent, Jul 18, 2014.

  1. Intelligent, Jul 18, 2014
    Last edited: Jul 19, 2014

    Intelligent macrumors 6502a

    Intelligent

    Joined:
    Aug 7, 2013
    #1
    How do i set a global variable, i have a variable that is the POSIX path that i choose, but i how do i declare it as global, normal ones are just set.

    EDIT: Applescript
     
  2. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
  3. Senor Cuete macrumors regular

    Joined:
    Nov 9, 2011
    #3
    Assuming that you are programming in C or Objective C, declare it outside of a function and just set it:

    Code:
    variable = value;
     
  4. superscape macrumors 6502a

    superscape

    Joined:
    Feb 12, 2008
    Location:
    East Riding of Yorkshire, UK
    #4
  5. Intelligent thread starter macrumors 6502a

    Intelligent

    Joined:
    Aug 7, 2013
    #5

Share This Page