ThreeClicks.com

The way to get to where you want to go today.

Ü ThreeClicks.com . . . We do Windows

 
 

Behind the Curtain

Where I might say a few words from time to time to notify visitors of changes or additions.
Yeah, right.

Or maybe I will just comment on some current event.

A policy of an eye for an eye, will only lead to everyone being blind.

Pay no attention to that man behind the curtain.

Ü oz@threeclicks.com

 

Contact Us | Search | About Us     
• Java Script Calculator

Samples: Calculator

 
 

 
 

ThreeClicks.com


How Does This Sample Work?
The calculator is an HTML table containing button controls. The buttons themselves are intrinsic <INPUT> style buttons, not Microsoft® ActiveX® controls. Microsoft® JScript® code is attached to the OnClick event for these buttons. The display is simply an intrinsic <INPUT> style text box. 
Notice the variable declared at the beginning of the <SCRIPT> tag, outside of any procedure: 


<SCRIPT LANGUAGE="JavaScript">
<!-- 
// Module-level variables
var FKeyPad = document.Keypad;
var Accum = 0; // Previous number (operand) awaiting operation
var FlagNewNum = false; // Flag to indicate a new number (operand) is being entered
var PendingOp = ""; // Pending operation waiting for completion of second operand
. . . view source for the rest Ü

These are module-level variables that persist for as long as the page is loaded. By contrast, variables declared within a procedure cease to exist as soon as the procedure exits. Thus, module-level variables can be used to store values that must persist between invocations of a procedure. Module-level variables are also visible to all procedures, and so are useful when multiple procedures need to share values. 

Hit Counter


ThreeClicks.com and Oz@ThreeClicks.com are trademarks of ThreeClicks.com, Inc.
Sarasota, Florida 34231 USA 
Other products mentioned may be trademarks of their respective companies.


Questions or problems regarding this web site should be directed to oz@threeclicks.com
Copyright © 1997 - 2008 ThreeClicks.com. All rights reserved.
TERMS OF USE
 

| RELOAD^ TOP | < BACK |     

........ Think Correctly  Ü ........ Think Correctly  Ü ........ Think Correctly  Ü