![]() |
Donate |
Programming
Click on 'Mode', 'Custom' to enter the custom mode. You can program up to 36 functions and assign them to the calculator's keys.
You have a few function preprogrammed to show you how it works.
Program language is RemObject Pascal Script. You can find more information about it in this page.
To modify or create a script, right click on a button, a new window with a highlighted code editor shows.
-You can access two internal objects of MyCalc2 :
-MainDisplay which is a TEdit and is the main display of the calculator.
-SecDisplay which is a TListBox and is the secondary display of the calculator.
You can access all their properties. You can for example change the color of the main display with this line of code :
MainDisplay.Color:=clred;->will turn the color of the main display to red.
You can access to the value of the stack and modify them.
The variables to access the stack are x,y,z,t.
You can now access the calculator's memory. The variable you have to used is called mem. It's an array[0..99] of extended. For instance if you want to access to STO 00, you'll have to read mem[0].
You can access different internal functions of MyCalc2 to format and display numbers:
-FormatMainDislplay(number) return a string : to format a number with the format used in MyCalc2. That is to say number of digits, thousand and decimal separators and mode (fix, sci or eng).
-FormatSecDisplay(number) return a string : to align the numbers properly in the secondary display.
-UpdateSecDisplay(string) : to store and display a line in the secondary display.
-To change the main display you only have to assign a new value to MainDisplay.Text : MainDisplay.Text := FormatMainDisplay(x) to display the value stored in the X register for example.
-CA() to clear displays, stack and memories
You can modify the angle mode with this 3 functions :
Deg()
Grad()
Rad()
You can choose the numbers format and the number of digits displayed with these functions :
Fix(number) with number the number of digits for the Fix mod.
Eng(number) with number the number of digits for the Eng mod.
Sci(number) with number the number of digits for the Sci mod.
The 'Compile' button will compile your script to verify if there are errors.
'Execute' will execute the script.
The arrow button store the script.
You can use some mathematical functions.
Here is a list of the available functions.
ArcCos,
ArcCosh
ArcCot
ArcCoth
ArcCsc
ArcCsch
ArcSec
ArcSech
ArcSin
ArcTanh
Ceil
Cosecan
Cosh
Cot
Coth
Csch
Floor
Log10
Hypot
IntPower
Log10
Log2
LogN
Power
RandomRange
Sec
Sech
Sinh
Tanh
Tan
You can use some Strings functions :
LeftStr(s:string; count:integer):string
MidStr(s:string;Start,Count:integer):string
RightStr(s:string; count:integer):string