JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 13th, 2013, 06:59 AM
cloudzell91 cloudzell91 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 5 cloudzell91 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 30 sec
Reputation Power: 0
Help...calculator memory function on M+,M-,MR..

hi all....
anyone knows how to code the function of MR,M+,M- in calculatorusing javascript?? .i did some code and no one works,,,

Reply With Quote
  #2  
Old January 13th, 2013, 07:11 AM
requinix's Avatar
requinix requinix is offline
Still alive
Click here for more information.
 
Join Date: Mar 2007
Location: Washington, USA
Posts: 12,711 requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)  Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 5 Months 1 Week 4 Days 6 h 45 m 38 sec
Reputation Power: 8969
Send a message via AIM to requinix Send a message via MSN to requinix Send a message via Yahoo to requinix Send a message via Google Talk to requinix
I can't imagine needing anything more complicated than M+ adding the value to a variable, M- subtracting the value from the same variable, and MR displaying the current value of the variable. I also can't imagine that being difficult or complicated to implement, but I can't see your code so...

Reply With Quote
  #3  
Old January 13th, 2013, 07:52 AM
cloudzell91 cloudzell91 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 5 cloudzell91 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 30 sec
Reputation Power: 0
Quote:
Originally Posted by cloudzell91
hi all....
anyone knows how to code the function of MR,M+,M- in calculatorusing javascript?? .i did some code and no one works,,,


heres the code

<html>
<head>
<title></title>
<script>
var x;
var memory = 0;
function cal(z)
{
x=eval(z.Input.value);
z.Input.value=x;
}
function boom(z)
{
z.Input.value=" ";
}

function memoryrecall(z)
{

var memory = ;
if (memory==0 ||{memory = ""}

}

function memorysub(z)
{

}






</script>
</head>
<body>
<form name="z">
<h3>Grade Calculator</h3>
<br/>
<hr width=500 align="left">

<INPUT TYPE="text" NAME="Input" Size="23">
<br/>
<INPUT TYPE="button" NAME="seven" VALUE="7" OnClick="z.Input.value += '7'" style="width: 40px; height: 40px" >

<INPUT TYPE="button" NAME="eight" VALUE="8" OnCLick="z.Input.value += '8'" style="width: 40px; height: 40px" >

<INPUT TYPE="button" NAME="nine" VALUE="9" OnClick="z.Input.value += '9'" style="width: 40px; height: 40px" >

<INPUT TYPE="button" NAME="plus" VALUE="+" OnClick="z.Input.value += ' + '"style="width: 40px; height: 40px" >
<br/>
<INPUT TYPE="button" NAME="four" VALUE="4" OnClick="z.Input.value += ' 4 '" style="width: 40px; height: 40px">

<INPUT TYPE="button" NAME="five" VALUE="5" OnClick="z.Input.value += '5'" style="width: 40px; height: 40px">

<INPUT TYPE="button" NAME="six" VALUE="6" OnCLick="z.Input.value += '6'" style="width: 40px; height: 40px">

<INPUT TYPE="button" NAME="times" VALUE="-" OnClick="z.Input.value += ' - '" style="width: 40px; height: 40px">
<br/>
<INPUT TYPE="button" NAME="one" VALUE="1" OnClick="z.Input.value += '1'" style="width: 40px; height: 40px">

<INPUT TYPE="button" NAME="two" VALUE="2" OnClick="z.Input.value += '2'" style="width: 40px; height: 40px">

<INPUT TYPE="button" NAME="three" VALUE="3" OnClick="z.Input.value += '3'" style="width: 40px; height: 40px">

<INPUT TYPE="button" NAME="times" VALUE="*" OnClick="z.Input.value += ' * '" style="width: 40px; height: 40px">
<br/>


<INPUT TYPE="button" NAME="zero" VALUE="0" OnClick="z.Input.value += '0'" style="width: 40px; height: 40px">
<INPUT TYPE="button" NAME="point" VALUE="." OnClick="z.Input.value += '.'" style="width: 40px; height: 40px">
<INPUT TYPE="button" NAME="equal" value="= " OnClick="cal(this.form)" style="width: 40px; height: 40px">


<INPUT TYPE="button" NAME="Divide" value="/" OnClick="z.Input.value += '/'" style="width: 40px; height: 40px">
<br/>



<INPUT TYPE="button" NAME="clear" VALUE="C" OnClick="boom(this.form)" style="width: 40px; height: 40px">


<INPUT TYPE="button" NAME="point" VALUE="MR" OnClick="memoryrecall(this.form)" style="width: 40px; height: 40px">

<INPUT TYPE="button" NAME="memorysub" VALUE="M-" OnClick="memorysub(this.form)" style="width: 40px; height: 40px">

<INPUT TYPE="button" NAME="memoryadd" VALUE="M+"OnClick="memoryadd(this.form)" style="width: 40px; height: 40px">








<hr width=500 align="left">
<h6>Copyright© 2013<br/>
</h3>


</form>
</body>

</html>


,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,
really dnt know mr,m+m-........

Reply With Quote
  #4  
Old January 13th, 2013, 08:09 AM
requinix's Avatar
requinix requinix is offline
Still alive
Click here for more information.
 
Join Date: Mar 2007
Location: Washington, USA
Posts: 12,711 requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)  Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 5 Months 1 Week 4 Days 6 h 45 m 38 sec
Reputation Power: 8969
Send a message via AIM to requinix Send a message via MSN to requinix Send a message via Yahoo to requinix Send a message via Google Talk to requinix
Syntax error aside, when you did the "var memory" inside the memoryrecall() function you lost access to the memory you defined outside it. Get rid of that statement and continue onwards.

Reply With Quote
  #5  
Old January 13th, 2013, 10:05 AM
cloudzell91 cloudzell91 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 5 cloudzell91 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 30 sec
Reputation Power: 0
<script>
var x;
var memory = 0;

function cal(z)
{
x=eval(z.Input.value);
z.Input.value=x;
}
function boom(z)
{
z.Input.value=" ";
}


function memoryrecall(z)
{
z.form.input.value = memory;


}

function memorysub(z)
{

memory = parseInt (el.form.input.value) - parseInt (memory);

}
function memoryadd(z)
{

memory = parseInt (z.form.input.value) + parseInt (memory);

}



</script>
,,,,
,,,,
still dont work,,,,

,,btw thanks 4 the help requinix

Reply With Quote
  #6  
Old January 13th, 2013, 12:32 PM
MrFujin's Avatar
MrFujin MrFujin is offline
Lord of the Dance
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Oct 2003
Posts: 3,130 MrFujin User rank is General 11st Grade (Above 100000 Reputation Level)MrFujin User rank is General 11st Grade (Above 100000 Reputation Level)MrFujin User rank is General 11st Grade (Above 100000 Reputation Level)MrFujin User rank is General 11st Grade (Above 100000 Reputation Level)MrFujin User rank is General 11st Grade (Above 100000 Reputation Level)MrFujin User rank is General 11st Grade (Above 100000 Reputation Level)MrFujin User rank is General 11st Grade (Above 100000 Reputation Level)MrFujin User rank is General 11st Grade (Above 100000 Reputation Level)MrFujin User rank is General 11st Grade (Above 100000 Reputation Level)MrFujin User rank is General 11st Grade (Above 100000 Reputation Level)MrFujin User rank is General 11st Grade (Above 100000 Reputation Level)MrFujin User rank is General 11st Grade (Above 100000 Reputation Level)MrFujin User rank is General 11st Grade (Above 100000 Reputation Level)MrFujin User rank is General 11st Grade (Above 100000 Reputation Level)MrFujin User rank is General 11st Grade (Above 100000 Reputation Level)MrFujin User rank is General 11st Grade (Above 100000 Reputation Level) 
Time spent in forums: 2 Months 2 Weeks 23 h 46 m 38 sec
Reputation Power: 1736
Please be more specific then just "don't work".
What does "not work"?
How have you tested it?
Any syntax or logic error?

Reply With Quote
  #7  
Old January 13th, 2013, 01:40 PM
cloudzell91 cloudzell91 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 5 cloudzell91 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 30 sec
Reputation Power: 0
Quote:
Originally Posted by MrFujin
Please be more specific then just "don't work".
What does "not work"?
How have you tested it?
Any syntax or logic error?

What does "not work"? the memory or the MR M- and M+..that all.


How have you tested it? Any syntax or logic error? ..i tried no functions at all,,,any errors? am just using notepad cant identify or hardly to identify...the error,,,,, that why i need help lolz
...sorry am not a programming wiz,,am learning on it lol,

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > Help...calculator memory function on M+,M-,MR..

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap