Author Topic: Exit Condition from Setpoint command  (Read 254 times)

bdeck

  • Hero Member
  • *****
  • Posts: 827
Exit Condition from Setpoint command
« on: May 06, 2017, 12:06:20 PM »
Please provide a variable such as sys(999) to indicate the exit condition from the setpoint command.
Thanks,
bd

DrollTroll

  • Kindly Curmudgeon
  • Administrator
  • *****
  • Posts: 4189
Re: Exit Condition from Setpoint command
« Reply #1 on: May 08, 2017, 06:16:48 AM »
Sys(1) should indicate the number of points actually set -- what other information are you looking for?
25 years with DesignCAD

bdeck

  • Hero Member
  • *****
  • Posts: 827
Re: Exit Condition from Setpoint command
« Reply #2 on: May 08, 2017, 03:36:13 PM »
Hi DT,

Doh!..... (edit)

I was looking for an indicator similar to sys(999) (escape key or return key on exit).

On reflection, it appears that the key can be deduced by comparing sys(1) to the prior value of sys(1) and the numerical parameter. Had forgotten that the escape key merely erases the last point set in the function, and does not exit the function unless it is pressed with no points set.

But on further reflection, there does not appear to be any way to determine which key was pressed when sys(1)=pntcount0 (in the example below).    (Edit)

Thanks,
bd

Quote
for i = 1 to 3
pntcount0=sys(1)
n=3
SETPOINT "set some points", n
if  sys(1)=pntcount0 then
        message "Esc Key pressed,  or Enter Keypressed with no points set.     (Edit) "
else
        if sys(1)<n then
                message "enter key pressed"
        else
                 message "n pnts set"
endif
next i
end
« Last Edit: May 30, 2017, 09:26:10 AM by bdeck »