WyeSoft

WyeSoft Lua Calc
Documentation

WyeSoft Lua Calc v1.0.0 - PC version (freeware)
http://www.wyesoft.com/
Copyright 2018 WyeSoft. All rights reserved.
Designed and created by Matthew A. Wood
Released 14 November 2018

 

Disclaimer

Download and use our software and webtools at your own discretion. WyeSoft cannot be held liable for any harm resulting from the use of our software or webtools or from the viewing of our website content.

 

Introduction

WyeSoft Lua Calc is a highly customisable scientific calculator, powered by the Lua scripting language. Knowledge of Lua scripting is not required to use Lua Calc as a scientific calculator, but it will allow you to use the software for more complex tasks, as you can make use of Lua functions in your calculations.

The scientific keypad is made up of 42 customisable keys (84 including the shifted versions), which can be configured to perform virtually any mathematical function. There is also a basic keypad which allows you to use Lua Calc as a simple calculator with larger buttons. Variables can be stored and recalled, and it is even possible to save them between sessions.

As well as a powerful calculator, Lua Calc can be a great aid to programmers, and can even help with learning Lua or programming in general.

 

Calculate or execute

You can enter both evaluations and statements into the input field. If the current input can be treated as an evaluation, such as 6+7, the enter button between the input and output fields will turn green and its caption will change to "Calculate". If a valid statement has been entered, which cannot be treated as an evaluation, such as x=30, the enter button will turn blue and read "Execute". If the input field contains neither a valid evaluation nor a valid statement, the button will turn red and its caption will disappear.

 

Recall previous output

The output from the most recent calculation is always stored in the ans variable. This can be used to make a new calculation based on the result of the previous one. For example, you could enter ans+8 and click the enter button repeatedly to have Lua Calc count upwards in 8's.

When using the onscreen keypad, starting a new command with an operator or a function, rather than a number, will cause Lua Calc to insert ans at the beginning (or in the appropriate place) automatically. For example, if you make a calculation and then start the next command with the + symbol, it will become ans+.

 

Key editor

To open the key editor, click the Edit key so that it lights up in purple, and then click on the keypad key you wish to edit. Now, for both the shifted and unshifted versions of the key, enter the text you want displayed on the key under "Label" and the text you want to be inserted when clicking on the key under "Insert".

The following special codes can be used in the Insert fields:

You can set the colour of the key by entering values between 0 and 255 in the Red, Green and Blue fields. The higher the number, the more of that primary colour is mixed into the key colour. For example, 128,0,255 will make the button purple.

 

Saved variables

A Lua table with the name, saved, is automatically created upon launching Lua Calc. The contents of this table will be saved and loaded between sessions, so it can be used to store numbers and other variables for future use. For example, if you were to enter saved.x=60 and then close Lua Calc, the next time you load the program, you could enter saved.x to recall the value of 60.

A string called savedjson, always contains a JSON-formatted copy of the saved table. This can be used to quickly check the entire contents of the table.

Note that functions cannot be stored in the saved table, at least not between sessions. It is, however, possible to store code in strings and run it using Lua's loadstring function.

 

Portability

WyeSoft Lua Calc is portable and does not require installation. Place the folder anywhere you want it and run LuaCalc.exe.

 

Lua copyright and permission notice

Copyright 19942018 Lua.org, PUC-Rio.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.