Author Topic: math calculations  (Read 202 times)

Graeme

  • Senior Community Member
  • Posts: 2103
  • Hero Points: 253
math calculations
« on: May 01, 2018, 12:22:32 am »
I often do math calculations on the slick command line and sometimes forget to put the word "math" at the start.  Slick then gives me "unknown command".  How about instead of giving unknown command, treat it as a math expression if it's numerical.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2068
  • Hero Points: 100
Re: math calculations
« Reply #1 on: May 01, 2018, 10:36:53 am »
I think the problem with this is that you can use +x or -x on the SlickEdit command line to move the cursor up or down a number of lines.

Love to hear users still use the command line ;)

Graeme

  • Senior Community Member
  • Posts: 2103
  • Hero Points: 253
Re: math calculations
« Reply #2 on: May 01, 2018, 12:21:16 pm »
If slick is going to output "invalid command" then it can't have been a goto line or up/ down command so there's no reason it couldn't check for a math expression.  Anyway I should probably bind the calculator tool to a key so I can bring it up quickly.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4157
  • Hero Points: 294
Re: math calculations
« Reply #3 on: May 01, 2018, 02:23:33 pm »
Unknown commands are parsed as external program command lines. If the program (path search first arg) isn’t found, then you get unknown command. Otherwise the external program is executed. This isnt used much. Not really a fan of having yet another meaning to something you type on the command line. I use the math commands a lot but I usually pick a specific one like mathx. That way the result i want is copied to the clipboard for pasting.