Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

18
LINES

< > BotCompany Repo | #1016083 // Java Calculator [Dyn Module]

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Libraryless. Click here for Pure Java version (16471L/117K).

!7

sclass JavaCalculator extends DynBigNumber {
  S input;
  
  void update {
    S s = dm_getInterestingString();
    if (regexpMatches("[0-9\\.\\-+*/() \t]+", s) && setField(input := s)) {
      setValue("Calculating...");
      try {
        setValue(javaEval(s));
      } catch e {
        setValue("ERROR");
        _handleException(e);
      }
    }
  }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1016083
Snippet name: Java Calculator [Dyn Module]
Eternal ID of this version: #1016083/3
Text MD5: a598fb3fed84b7bb383df390592cfef8
Transpilation MD5: 680a48f7463a9ae12baf3e0c9d90186d
Author: stefan
Category: javax / stefan's os
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-06-08 18:41:04
Source code size: 379 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 358 / 629
Version history: 2 change(s)
Referenced in: #1016755 - Java Eval [Evaluate Java Code, Dyn Module]