Page 2 of 2

Re: RPN Interpreter Eval function

Posted: Sat Oct 12, 2019 6:39 am
by Kwai chang caine
Hello my friend, i'm happy to read you :D, because it's not the case since a long time :|
Works great here with W10 X86 / v5.70 X86
courageous wrote:varA=Hello
Nearly a begin of JavaScript :wink:
courageous wrote:I wrote it over a few early mornings when I couldn't sleep
Like what the misfortune of some, makes the happiness of others :lol:

Thanks for sharing 8)

Re: RPN Interpreter Eval function

Posted: Sat Oct 12, 2019 10:30 pm
by idle
thanks Kcc, I'm still about, just not doing much with PB these days.

Re: RPN Interpreter Eval function

Posted: Mon Feb 17, 2020 4:33 pm
by kinglestat
This looks something interesting...and was trying to cannibalize it from my non nefarious reasons.
I was trying to figure out if it "remembers" variables as long lines are something I avoid

Code: Select all

*rpn.IRPN = NewRPN()
Debug *rpn\Eval("a = 5")
This crashes it...and can't see why

Re: RPN Interpreter Eval function

Posted: Mon Feb 17, 2020 11:27 pm
by idle
It crashed as the stack was empty and there's nothing to evaluate. I added a trap to avoid the crash.
You can build statements up like Statement.s + "a=5 " and then call the eval but it only works on a single input string and it's fiddly. It was just a toy to idle away early mornings when I couldn't sleep and suffered feature creep but with a little care it works.

Re: RPN Interpreter Eval function

Posted: Tue Feb 18, 2020 6:26 am
by kinglestat
I understand insomnia...nice work