Page 1 of 2

if command not working

Posted: Sat Oct 25, 2014 6:20 pm
by David wyatt

Hi support team,

i have an issue that i cant understand and is to explain. i have shared my app with you its called hit, if you could take a look please

there are 6 main inputs
x,y,xx,yy,xxx,yyy
the javacscript reports an alert if x is below xx, then reports an alert if above xxx. same for y with yy and yyy. if x and y are in between xx/xxx and yy/yyy it should add 1 to score.
i used xxxx to generate the alerts. it sometimes works then doesnt with no pattern explaining why it does.

please help


if command not working

Posted: Sat Oct 25, 2014 7:02 pm
by Alena Prykhodko

Hello,

Have you tried to debug your code (http://devcenter.appery.io/documentat...) ?


if command not working

Posted: Sat Oct 25, 2014 7:14 pm
by David wyatt

Hi
ive tried browser and weinre debugging but cant find any bugs. its a very simple chain of IF commands that works then doesnt with no apparent reason.


if command not working

Posted: Sat Oct 25, 2014 7:20 pm
by David wyatt

if command not working

Posted: Sat Oct 25, 2014 7:25 pm
by Alena Prykhodko

Could you please post code you use.


if command not working

Posted: Sat Oct 25, 2014 7:27 pm
by David wyatt

x= Apperyio('xin').val();
y= Apperyio('yin').val();
xx= Apperyio('xx').val();
xxx= Apperyio('xxx').val();
var score= Apperyio('score').val();
yy= Apperyio('yy').val();
yyy= Apperyio('yyy').val();
alert(x+"-"+y+"-"+xx+"-"+yy+"-"+xxx+"-"+yyy);
if (xxxx) {
alert("x high"); }
else if (yyyy) {
alert("y high"); }
else {
++score;

Code: Select all

     alert("score "+score); }

if command not working

Posted: Sat Oct 25, 2014 7:28 pm
by David wyatt

x= Apperyio('xin').val();
y= Apperyio('yin').val();
xx= Apperyio('xx').val();
xxx= Apperyio('xxx').val();
var score= Apperyio('score').val();
yy= Apperyio('yy').val();
yyy= Apperyio('yyy').val();
alert(x+"-"+y+"-"+xx+"-"+yy+"-"+xxx+"-"+yyy);
if (xxxx) {
alert("x high"); }
else if (yyyy) {
alert("y high"); }
else {
++score;
alert("score "+score); }


if command not working

Posted: Sun Oct 26, 2014 11:03 am
by David wyatt

Hi,
for some reason the command isnt showing how im inputting it, it should look like the following Image


if command not working

Posted: Sun Oct 26, 2014 11:37 am
by Illya Stepanov

Hi David,

Use pre<code>code/code/pre tag to wrap your code.

It's working for me correctly with this code:
pre
code
x = Apperyio('xin')&#46;val();
y = Apperyio('yin')&#46;val();

xx = Apperyio('xx')&#46;val();
xxx = Apperyio('xxx')&#46;val();
var score= Apperyio('score')&#46;val();
yy = Apperyio('yy')&#46;val();
yyy = Apperyio('yyy')&#46;val();

alert(x+"-"+y+"-"+xx+"-"+yy+"-"+xxx+"-"+yyy);

if (x < xx) {
alert("x low");
} else if (x > xxx) {
alert("x high");
} else if (y < yy) {
alert("y low");
} else if (y > yyy) {
alert("y high");
} else {
++score;

Code: Select all

     alert("score "+score);  

}
/code
/pre


if command not working

Posted: Sun Oct 26, 2014 11:50 am
by David wyatt

ive also tested the same code in html file and it works fine.