# Pointer to variable?

## Recommended Posts

can i do something like that?

something like what c/c++ programming does,

a=1

b=2

c[1] = &a

c[2] = &b

The speed of sound is defined by the distance from door to computer divided by the time interval needed to close the media player and pull up your pants when your mom shouts "OH MY GOD WHAT ARE YOU DOING!!!"

##### Share on other sites

can i do something like that?

something like what c/c++ programming does,

a=1

b=2

c[1] = &a

c[2] = &b

Actually no, pointers to variables are not implemented. However, there are some forms of pointers available in AutoIT. See passing function parameters "byref" and DllStructGetPtr(), but that's not what you are asking for.

Well, you could do this:

```\$a=1
\$b=2

dim \$c[2]

\$c[0] = "a"
\$c[1] = "b"

msgbox(0,"","\$a = " & eval(\$c[0]) &  " \$b = " & eval(\$c[1]))```

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

##### Share on other sites

Well, you could do this:

```\$a=1
\$b=2

dim \$c[2]

\$c[0] = "a"
\$c[1] = "b"

msgbox(0,"","\$a = " & eval(\$c[0]) &  " \$b = " & eval(\$c[1]))```

Cheers

Kurt

That seems pretty close to what I'm looking for

so if I were to do this:

`eval(\$c[0]) = 3`

would \$a = 3 as well?

The speed of sound is defined by the distance from door to computer divided by the time interval needed to close the media player and pull up your pants when your mom shouts "OH MY GOD WHAT ARE YOU DOING!!!"

##### Share on other sites

Almost. Eval() doesn't work the other way around -- you would use Assign() here:

```Local \$A, \$B, \$C[2]

\$A = 1
\$B = 2

\$C[0] = 'A'
\$C[1] = 'B'

MsgBox(0x40, 'Values of \$A and \$B', '\$A = ' & Eval(\$C[0]) & @LF & '\$B = ' & Eval(\$C[1]))

Assign(\$C[0], 3)
Assign(\$C[1], 4)

MsgBox(0x40, 'Values of \$A and \$B', '\$A = ' & Eval(\$C[0]) & @LF & '\$B = ' & Eval(\$C[1]))```
##### Share on other sites

Great!! That's exactly what I'm looking for!!

Thanks!!

The speed of sound is defined by the distance from door to computer divided by the time interval needed to close the media player and pull up your pants when your mom shouts "OH MY GOD WHAT ARE YOU DOING!!!"

## Create an account or sign in to comment

You need to be a member in order to leave a comment

## Create an account

Sign up for a new account in our community. It's easy!

Register a new account

• ### Recently Browsing   0 members

×

• Wiki

• Back

• #### Beta

• Git
• FAQ
• Our Picks
×
• Create New...