if command not working

This forum contains topics that were moved from Get Satisfaction
David wyatt
Posts: 0
Joined: Mon Sep 15, 2014 7:12 pm

if command not working

Post 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

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

if command not working

Post by Alena Prykhodko »

Hello,

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

David wyatt
Posts: 0
Joined: Mon Sep 15, 2014 7:12 pm

if command not working

Post 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.

David wyatt
Posts: 0
Joined: Mon Sep 15, 2014 7:12 pm

if command not working

Post by David wyatt »

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

if command not working

Post by Alena Prykhodko »

Could you please post code you use.

David wyatt
Posts: 0
Joined: Mon Sep 15, 2014 7:12 pm

if command not working

Post 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); }
David wyatt
Posts: 0
Joined: Mon Sep 15, 2014 7:12 pm

if command not working

Post 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); }

David wyatt
Posts: 0
Joined: Mon Sep 15, 2014 7:12 pm

if command not working

Post by David wyatt »

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

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

if command not working

Post 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

David wyatt
Posts: 0
Joined: Mon Sep 15, 2014 7:12 pm

if command not working

Post by David wyatt »

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

Post Reply