Concatenar variables - Forum

Forum Navigation
You need to log in to create posts and topics.

Concatenar variables

Hola Gente:

He visto post para combinar Variables pero necesito concatenarlas y pues no sale. Al hacerlo da un error de compilación y cuando edito el comando me borra la segunda variable. Este es el ejemplo:

SetVar [arma] [arma] [otrodato]

La idea no es armar un Array, ojo, la idea es concatenar estas dos variables.

Saludos!

 

ING:

Hello people: I've seen a post to combine Variables but I need to concatenate them and it does not come out. Doing so gives a compilation error and when I edit the command it deletes the second variable. This is the example:

SetVar [arma] [arma] [otrodato]

The idea is not to build an Array, the idea is to concatenate these two variables. Regards!

 

@palamar

Try this ...

SetVar [weapon] "Gun"
SetVar [otherStory] "Bullets"

SetVar [weapon] "[weapon][otherStory]"

AlertBox "Concatenated" "[weapon]" ""

... if desired, you can leave space(s) between the two variables.

 

Updated: Note that the Code Editor on this forum is injecting spaces after [ and before ]

Gracias @Gaev, tu ayuda fue importante para darme cuenta que la acción Setvar que concatena debe ir con " (comillas) para que funcione. VisualNeo no las pone por defecto (utiliza numérico)

Saludos!

 

ENG:

Thanks @Gaev, your help was important to realize that the Setvar action that concatenates must go with "(quotes) to make it work." VisualNeo does not set them by default (use numeric) Regards!

The below code is not work for me .

neoGetPosition [x] [y]
SetVar [z] "[x],[y]"

@asmat

I am running VisualNEOWeb version 2019 4.5 ... and there is no such command as neoGetPosition ... is this part of a later version ? ... or an add-on plugin ?

neoGetPosition [x] [y]
SetVar [z] "[x], [y]"

Assuming that neoGetPosition populates the variables [x] and [y] with x and y positions of something, they would be numbers ? ... unless there are text values like px appended to the numbers.

So, what makes you say that the concatenation does not work ? ... what are the values returned for [x] and [y] ... and [z] ?

@asmat, the exact same code works fine for me (you need to give permission so the app can access your location)
@gaev, that command belongs to the geolocation plugin.
Regards.