GlassCalc version 1.25 fixes a crash when you check for updates while GlassCalc is already checking for updates. It also reads an “extensions.ini” file, which currently allows you to define extra constants, but may be expanded to let you extend GlassCalc in other ways in the future.
To add your own constants to GlassCalc, go to the More Settings menu and open the Extensions tab. You will see two sections: Global Extensions and User Extensions. Global extensions are system-wide and reside in GlassCalc’s program files directory. This means modifying them on Vista/Win 7 requires elevation. (I have not tested this on XP, so please tell me if it gives you trouble) User extensions apply only to your user profile and reside in GlassCalc’s application data directory. For normal cases, I suggest you use only user extensions. If both extensions files are present, user settings will override global ones.
To create the extensions settings file, click Create extensions.ini. The settings file will be created with the default settings and opened. (If you don’t have file associations for .ini files, you should get an Open With dialog. Pick a text editor.) Constant definitions go after the line with [Constants]. Everything on a line after a semicolon is ignored. Each line can contain one definition in the form “name = value”, where “name” contains only letters, numbers, and underscores and doesn’t start with a number. “value” can be any number (exponential notation is supported) or any numeric field, constant, or property defined in mscorlib.dll. (If you are not a .NET programmer, you can safely ignore that last bit.) If the value is not defined in System, you must provide the full namespace as well.
Here is an example file showing some of the ways constants can be defined:
;Stuff after a semicolon is a comment. [Constants] euler = 0.577215664901532860606512090082 ;Euler's constant planck = 6.6260689633e-34 ;Planck's constant using exponential notation pi = Math.PI ;pi using .NET's built in constant
GlassCalc should update its constants list when you close your text editor. If it does not, try clicking Edit extensions.ini from the settings menu and closing your text editor again. If all else fails, restart GlassCalc and it will pick up the updated settings. If you defined a new constant with the same name as an already present variable, you will need to restart GlassCalc for the changes to take effect.
If any of this isn’t clear or isn’t working, don’t hesitate to ask in the comments section below!