Notepad3: TinyExpr: Support math expression evaluation in text

Created on 9 Aug 2018  路  7Comments  路  Source: rizonesoft/Notepad3

Support math expression evaluation in text, e.g. by TinyExpr library.
So simple math expressions results can be calculated "on the fly" in text.

A prototype is available as development beta: _X_MUI_4.18.809.1048:

  • Select an math expression and the result is displayed in the statusbar (| Eval nn.mm |)
  • If expression can not be evaluated, an error indicator is shown (| Eval ^[n] |),
    where the 'n' indicates the error position in the selection.
  • A double-click in the "| Eval nn.mm |" section of the status-bar will copy the value to the clipboard.

This is a evaluation prototype, so there are many enhancements to that 1st draft possible:

  • Make it switchable by Settings Menu (handling of the status-bar section)
  • Feed result at caret position into document on "magic" char combi (e.g. "=:")
  • result display in status-bar section is not the right place ... better proposal?
  • beside the "on the fly" interpreter, support compiled expression with unbound variables
    and bind variables at evaluation trigger times
  • throw it to byte recycle bin completely ...
  • ... further suggestions ...

Please keep in mind: keep it simple and usable - I don't want to build a new "MS Excel" here.
Discussion is opened...

enhancement / feature req.

All 7 comments

Hello @RaiKoHoff ,
Tested version: Notepad3 (64-bit) X_MUI v4.18.809.1048

Suggestions: 馃

  • Instead of using the status bar to shows the Eval:, showing the Eval: in a popup window?
  • given the possibility to adjust the number of digit showed (now is max: 7)
  • using regional/local settings to shows the "." of "," for digital and digital grouping symbols

Issues:

[Window] (Settings Out of the Box)
1920x1080 HighDpiToolBar=0
1920x1080 PosX=944
1920x1080 PosY=16
1920x1080 SizeX=960
1920x1080 SizeY=1008
1920x1080 Maximized=0
1920x1080 Zoom=0

  • From a new installation "Out of the Box" or after pushing on "Snap to Default Position" the result "Eval: is incompletely displayed !

otb

  • After a NP3 window resizing horizontally (in + or in -), the Eval: is correctly displayed !

resize

@hpwamr : Thank you for testing.
My vote against a Popup is:
I like the "on the fly" calculation by selection, but I don't like to be disturbed by a Popup every time I select something what might be a valid expression ... 馃

About the other points: Will see, if can do something ...

Please check current development beta: _TinyExpr_4.18.814.1056
Selecting Language Parameter:
[Settings2] PreferedLanguageLocaleName changed to PreferredLanguageLocaleName ('rr')
New Fractional-Font-Size dialog available (if Direct2D/DirectWrite is enabled) (experimental)
New Font dialog: -> new strings for language translations ... 馃

From a new installation "Out of the Box" or after pushing on "Snap to Default Position" the result "Eval: is incompletely displayed !

Tested with Notepad3 (64-bit) TinyExpr v4.18.815.1057
Now the result "Eval:" is correctly displayed ! 馃憤

New development beta version (_TinyExpr_4.18.823.1069):

  • add logical expressions
  • evaluation of current line triggered by sequence "=?", replacing '?' by result, if valid expression is found before "=?".

New development beta version (_TinyExpr_4.18.825.1072) now supports "_Rectangular Selections_".
Row separated numbers are internally combined by "+"(add), "-"(minus) numbers have to be make explicit:

image
image

As far as I am concerned, this issue may be closed....

Was this page helpful?
0 / 5 - 0 ratings

Related issues

craigo- picture craigo-  路  3Comments

blackcrack picture blackcrack  路  3Comments

hpwamr picture hpwamr  路  4Comments

hpwamr picture hpwamr  路  3Comments

dlong500 picture dlong500  路  3Comments