Page 1 of 1

Local Varibles

Posted: Tue May 27, 2014 5:26 pm
by themob212 .

Can I make a local varible random (between one and ten) as an event?

Thank you!


Local Varibles

Posted: Tue May 27, 2014 5:50 pm
by Evgene Karachevtsev

Hello,

Please, take a look at this link: https://getsatisfaction.com/apperyio/...


Local Varibles

Posted: Wed May 28, 2014 12:25 am
by themob212 .

Thanks. Thats close to what I want but I really just want to know if I can use the on click section to create the random local variable OR can I have it insert it insert an existing string.
.
If I cannot, I can follow most of the link and know that you want me to stick that into the javascript thing and have it run on click but I am unsure what I am doing in terms of mapping the request data from my service :S

Sorry, very tired newbie here :)


Local Varibles

Posted: Wed May 28, 2014 1:39 pm
by Illya Stepanov

Hi -

Following the example of the link above:
precode
var min = 1, max = 10;
var rand = min - 0.5 + Math.random () * (max-min +1)
rand = Math.round (rand);
/code/pre
rand variable will be a random number from 1 to 10.