#1 2016-10-28 09:17:01

Kasito
Banned
Registered: 2016-08-05
Posts: 58

How to join a couple of app's variables into a new app's variable

Hi.

im trying to add two result from different variables such as:

random "[kaase1]"
random "[kaase2]

SetVar "[mynumber]" "[kaase1+kaase2]" "Number"

i was expecting this will add the two results and store them in the new var.

or how can i achieve such?

Last edited by Kasito (2016-10-28 09:20:00)

Offline

#2 2016-10-28 10:04:31

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,661
Website

Re: How to join a couple of app's variables into a new app's variable

Hello Kasito,

Please, try something like this:

Random "[RandomOne]"
Random "[RandomTwo]"

SetVar "[JoinedRandom]" "[RandomOne][RandomTwo]" "String"

AlertBox "[JoinedRandom]" "info"

Offline

#3 2016-10-28 12:50:20

Kasito
Banned
Registered: 2016-08-05
Posts: 58

Re: How to join a couple of app's variables into a new app's variable

ok. thanks will try that.

But can the each Random generate more than 10 digits?   lets say up to 12

Offline

#4 2016-10-28 14:35:29

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,661
Website

Re: How to join a couple of app's variables into a new app's variable

Hello Kasito,

The "Random" action can return any number without controlling their "length". On the other hand the "RandomEx" action allows to use a range, but we can't guarantee a random number of 12 digits everytime. In fact random numbers are more complex than appear for non experts, me included. However, take a look at the below code. Maybe they do the job that you wanted.

SetVar "[Result]" "" "String"

Loop "1" "12" "[I]"

  RandomEx "0" "9" "[RandomNum]"

  If "[Result]" "==" ""
    SetVar "[Result]" "[RandomNum]" "String"
  Else
    SetVar "[Result]" "[Result][RandomNum]" "String"
  EndIf

EndLoop

AlertBox "[Result]" "info"

Offline

Board footer

Powered by FluxBB


Copyright ©2018 DecSoft. All rights reserved.