Reverse of $$

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bob Stearns

    Reverse of $$

    $$ allows on to put a variable name in another variable and use it. I
    would like a function, usable only in UDFs, that would return the actual
    variable name associated with a function argument. This is,
    approximately, the inverse of $$. One can achieve this by requiring the
    user to to send all arguments as strings and using $$ throughout, but
    that puts an undue burden on the function user.
  • Oli Filth

    #2
    Re: Reverse of $$

    Bob Stearns wrote:[color=blue]
    > $$ allows on to put a variable name in another variable and use it. I
    > would like a function, usable only in UDFs, that would return the actual
    > variable name associated with a function argument. This is,
    > approximately, the inverse of $$.[/color]

    Not possible. Think about it - what if the arguments aren't named
    variables, e.g.:

    foo(6, 6*$val, getNumber());

    --
    Oli

    Comment

    • Chung Leong

      #3
      Re: Reverse of $$


      Bob Stearns wrote:[color=blue]
      > $$ allows on to put a variable name in another variable and use it. I
      > would like a function, usable only in UDFs, that would return the actual
      > variable name associated with a function argument. This is,
      > approximately, the inverse of $$. One can achieve this by requiring the
      > user to to send all arguments as strings and using $$ throughout, but
      > that puts an undue burden on the function user.[/color]

      But how do you refer to the variable when you don't know its name?

      Comment

      • Oli Filth

        #4
        Re: Reverse of $$

        Bob Stearns wrote:[color=blue]
        > $$ allows on to put a variable name in another variable and use it. I
        > would like a function, usable only in UDFs, that would return the actual
        > variable name associated with a function argument. This is,
        > approximately, the inverse of $$.[/color]

        Not possible. Think about it - what if the arguments aren't named
        variables, e.g.:

        foo(6, 6*$val, getNumber());

        --
        Oli

        Comment

        Working...