Scite Calculator

lua-users home
wiki

SciTECalculator is a calculator application that runs inside SciTE.

Web site: http://sl-calculator.luaforge.net/

Description: SciTECalculator is a self-contained SciTE "application" that opens in a new buffer window when you run the script. The calculator looks like a calculator drawn in text mode, and is operated by key presses and mouse double-clicks. You can use the calculator just as you would use a normal calculator.

The basic calculator script is feature-complete; all buttons and associated keys work.

Being a Lua script, it can be easily extended to suit one's needs. SciTECalculator is compatible with SciteExtMan. For users who use proportional fonts, you can use SciteMakeMonospace to avoid the hassle of always switching to monospace font mode.

Calculator Screen


+------------------------------------------------+

| SciTE Basic Calculator                ver. 0.5 |

+------------------------------------------------+

|/-\/---\/--------------------------------------\|

|| ||Dec||                                    0 ||

|\-/\---/\--------------------------------------/|

|------------------------------------------------|

| +-----+-----+-----+-----+  +----+-----+------+ |

| | Hex | Dec | Oct | Bin |  | <- |  C  |  AC  | |

| +-----+-----+-----+-----+  +----+-----+------+ |

| +----+ +-----+-----+-----+ +-----+-----+-----+ |

| | MC | |  7  |  8  |  9  | |  /  | Mod | And | |

| +----+ +-----+-----+-----+ +-----+-----+-----+ |

| | MR | |  4  |  5  |  6  | |  *  | Or  | Xor | |

| +----+ +-----+-----+-----+ +-----+-----+-----+ |

| | MS | |  1  |  2  |  3  | |  -  | Lsh | Not | |

| +----+ +-----+-----+-----+ +-----+-----+-----+ |

| | M+ | |  0  | +/- |  .  | |  +  |  =  | Int | |

| +----+ +-----+-----+-----+ +-----+-----+-----+ |

| +----+ +-----+-----+-----+ +-----+-----+-----+ |

| | PI | |  A  |  B  |  C  | |  D  |  E  |  F  | |

| +----+ +-----+-----+-----+ +-----+-----+-----+ |

+------------------------------------------------+



+-----------------------------------------------------------+

| SciTE Basic Calculator by <khman@users.sf.net> 20060904   |

| Use by pressing keys as you would in a normal calculator, |

| or double-click the "buttons". Press 'H' for help.        |

+-----------------------------------------------------------+

Help Screen


               Help for SciTE Basic Calculator

               -------------------------------



The following keys are recognized by the calculator:



    [Space]      All clear (AC)

    X            Cancel number (C)

    Z, \         Delete last character (<-)

    [Enter], =   Evaluate (=)

    1-9, A-F     Digits, hexadecimal digits

    .            Decimal point

    /, *, -, +   Basic operations

    Q, R, S, T   Memory operations (MC, MR, MS, M+)

    I            Truncate fractional portion (Int)

    H            Toggle help screen

    [, ]         Switch radix



This calculator is not meant for heavy-duty work. Non-decimal

bases and some operations can only work with 32 bit signed

integers. There is no support for scientific notation entry.



This script has been declared by the author to be public domain

code. Author information can be found in the Lua sources.

See http://lua-users.org/wiki/SciteScripts for more scripts.



Press H again to return to the calculator display...


RecentChanges · preferences
edit · history
Last edited October 31, 2009 3:39 pm GMT (diff)