Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently June 3rd, 2024, 3:05 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: HTML5 incorrect result
PostPosted: September 13th, 2014, 6:47 pm 
Offline

Joined: February 24th, 2011, 1:08 pm
Posts: 3
Opus: 7
Hello all,

After a break of more than a one and a half year i'm back. Bought version 9. Refreshed my brain and my first HTML5 project is a fact.
It works almost as i hoped but there is something strange that i can't solve.

I made a calculation module for a sport.
The first number needs to be multiplied by 5, the second by 4 and the last counts only 1 time.
That works great in opus, and the second time also online.

The problem is the first time...
The first time the result is messed up and wrong. After you push the reset button you get the right answer.
What's the problem with the first time and how can i clear that problem.
This fault only appears online, not in the edit mode on Opus9
http://csnmedia.nl/klasseb.htm

Like to hear from one of you, Ad


For this message internetsoftware has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: HTML5 incorrect result
PostPosted: September 13th, 2014, 9:57 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Without the source, it's not possible to say exactly what you've done - but it appears that the values being totalled are defined (or at least JavaScript thinks so) as strings rather than numbers.

JavaScript will concatenate values it thinks are strings rather than add them. so 20 + 40 + 60 becomes 204060 because somewhere something is causing it to think it is actually "20" + "40" + "60".

Have you defined the variables as numbers?

Post the IMP if you cannot find the cause.

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: Re: HTML5 incorrect result
PostPosted: September 14th, 2014, 6:42 am 
Offline

Joined: May 16th, 2008, 4:50 pm
Posts: 368
Location: Berghem The Netherlands
Opus: Opus Pro 9.75
OS: Windows 10
System: `HP
Thanks Mack,

The variables didn't have a value, that was the problem.
It's working great now.
http://csnmedia.nl/klasseb.htm

_________________
Opus Pro v9.75
Windows 10 on HP EliteBook i7
http://www.csnmedia.nl


For this message Ad Mulders has been thanked by : mackavi


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group