How to "save" variable

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • sindre hiåsen

    How to "save" variable

    Hi,

    I need a way to save a variable in a function.

    I want to do something like this.
    On functioncall set a variable and another function call gets the variable
    set by the other function call.

    Something like this.

    function set_get(name)
    {
    if(name != "")
    var name = name;
    else
    return name;
    }

    Sindre
  • sindre hiåsen

    #2
    Re: How to "save&quot ; variable

    On Mon, 13 Jun 2005 15:07:47 +0200, sindre hiåsen <sindrehi@c2i.n et> wrote:
    [color=blue]
    > Hi,
    >
    > I need a way to save a variable in a function.
    >
    > I want to do something like this.
    > On functioncall set a variable and another function call gets the
    > variable set by the other function call.
    >
    > Something like this.
    >
    > function set_get(name)
    > {
    > if(name != "")
    > var name = name;
    > else
    > return name;
    > }
    >
    > Sindre[/color]

    Hi,

    Sorry to bother. This was as simple as I thought, so I did find it out.

    Sindre

    Comment

    Working...