VirtualBox

Changeset 2685 in kBuild for trunk/VSlickMacros


Ignore:
Timestamp:
Jul 4, 2013 7:50:01 PM (12 years ago)
Author:
bird
Message:

kdev.e: Added calc command and attached it to C-S-C.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/VSlickMacros/kdev.e

    r2683 r2685  
    5959defeventtab default_keys
    6060def  'C-S-A' = k_signature
    61 def  'C-S-C' = k_javadoc_classbox
     61//def  'C-S-C' = k_javadoc_classbox
     62def  'C-S-C' = k_calc
    6263def  'C-S-E' = k_box_exported
    6364def  'C-S-F' = k_javadoc_funcbox
     
    29462947
    29472948
     2949/**
     2950 * Command similar to the add() command in math.e, only this
     2951 * produces hex and doesn't do the multi line stuff.
     2952 */
     2953_command int k_calc()
     2954{
     2955    _str sLine;
     2956    filter_init();
     2957    typeless rc = filter_get_string(sLine);
     2958    if (rc == 0)
     2959    {
     2960        _str sResultHex;
     2961        rc = eval_exp(sResultHex, sLine, 16);
     2962        if (rc == 0)
     2963        {
     2964            _str sResultDec;
     2965            rc = eval_exp(sResultDec, sLine, 10);
     2966            if (rc == 0)
     2967            {
     2968                _end_select();
     2969                _insert_text(' = ' :+ sResultHex :+ ' (' :+ sResultDec :+ ')');
     2970                return 0;
     2971            }
     2972        }
     2973    }
     2974
     2975    if (isinteger(rc))
     2976        message(get_message(rc));
     2977    else
     2978        message(rc);
     2979    return 1;
     2980}
     2981
     2982
    29482983
    29492984/*******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette