Jump to content
Xtreme .Net Talk

sassur

Members
  • Posts

    5
  • Joined

  • Last visited

sassur's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Thanks, but not exactly that. It seams that you cant use the Eval function to achieve what I want, but i havenät looked into it very deeply.
  2. It look's more complicated then it is. The key to it is the variable $var I will try to explane each line by it self $name1 = "Fredrik"; initiates $name1 to Fredrik $name2 = "Andreas"; initiates $name2 to Andreas $var = "name1"; initiates $var to name1 echo $var . " = " . ${$var}; this will print : name1 = Fredrik take a look at ${$var}, that code means: the variable with the name in variable $var therefore ${$var} equels the variable $name1 echo "<br>"; prints "<br>" $var = "name2"; set $var to name2 echo $var . " = " . ${$var}; name1 = Andreas now the variable $var conatins name2 therefore ${$var} equels the variable $name2 echo "<br>"; prints "<br>" Hoppes this makes it a little clearer.
  3. But as I said i the previous post, that isn't what I'm asking for. Trying to explain better: $name1 = "Fredrik"; $name2 = "Andreas"; $var = "name1"; echo $var . " = " . ${$var}; echo "<br>"; $var = "name2"; echo $var . " = " . ${$var}; echo "<br>"; and the output will be name1 = Fredrik name2 = Andreas
  4. For a starter thats classic VB I asked about C# or VB.NET. And thats not what I asked for. I know how to define a variable and print it to the page.
  5. In PHP you can do this $name = "Fredrik"; $var = "name"; echo ${$var}; and the output will be Fredrik Now I wonder if you can do somethins similar in C# or VB.NET? --- Sassur
×
×
  • Create New...