exec.Question()

If you think you've found a bug post it here.

exec.Question()

Postby Vmax549 » Wed Jan 24, 2018 9:07 pm

I found a Glitch with using Question() . It will not take a negative number.

.002 works
-.002 does not work

and yes I could use Text Question and convert to double. BUT if anything gets entered that will not convert to double you get an INTERNAL ERROR. That would not be user friendly.

(;-) TP
Vmax549
 
Posts: 1297
Joined: Sun Nov 22, 2015 3:25 am
Location: USA

Re: exec.Question()

Postby cncdrive » Thu Jan 25, 2018 1:40 pm

Hi Terry,

Yes, I got your email sorry for not replying yet, I just got to check it out.
The issue in the code which you have sent is that you calling the button 130 in the beginning of the macro which is the Stop button call,
which basicly tells the UCCNC to stop the macro execution, is sets the macrostop variable to false and so the question function no more works,
It internally generates an exception which you see and it is because the answer string is then empty, so it will not convert to double.
I will check how this could be changed...

For now you could put the Question in a try/catch so then it will not generate a visible exception.
And you should not call the Stop button in the beginning, because it tells the software to stop code execution including the macro which is currently being executed.

And I will check why it does not accept negative numbers.
But again you could do your own try/catch to catch and not to show the internal error, so you could temporarily fix it with the TextQuestion and then try to convert it to double and handle the exception if the input was not a number.
cncdrive
Site Admin
 
Posts: 2260
Joined: Tue Aug 12, 2014 11:17 pm

Re: exec.Question()

Postby cncdrive » Thu Jan 25, 2018 3:05 pm

I've checked why the Question does not accept negative numbers and basicly to accept the - character as first character for data input, this part of code was missing. I've now added this code, so the next release will accept negative numbers.
cncdrive
Site Admin
 
Posts: 2260
Joined: Tue Aug 12, 2014 11:17 pm

Re: exec.Question()

Postby Vmax549 » Thu Jan 25, 2018 5:54 pm

I am not sure of why it affects teh active macro as it is running outside any macro running in teh Gcode. Yes teh ButtonCall does stop macros BUT this one is still running otherwise it would not finish running teh script.

IF I remove teh Question() line and use a VAR with a value teh macro will complete properly So that should mean teh CallButton() did not really kill teh macro ?? otherwise it would not run ??

Yes there is a way around it but it is a bit clunky.

Thanks for teh help, (;-) TP
Vmax549
 
Posts: 1297
Joined: Sun Nov 22, 2015 3:25 am
Location: USA

Re: exec.Question()

Postby Vmax549 » Thu Jan 25, 2018 7:26 pm

OK I work a way around teh problem and Z height correction now works OK.

(;-) TP
Vmax549
 
Posts: 1297
Joined: Sun Nov 22, 2015 3:25 am
Location: USA

Re: exec.Question()

Postby cncdrive » Fri Feb 23, 2018 4:47 pm

This was fixed in version 1.2103.
cncdrive
Site Admin
 
Posts: 2260
Joined: Tue Aug 12, 2014 11:17 pm


Return to Report a bug

Who is online

Users browsing this forum: No registered users and 4 guests