Author Topic: is it possible to pause in a loop and wait for next input?  (Read 1516 times)

0 Members and 1 Guest are viewing this topic.

andrew_nao

  • Guest
is it possible to pause in a loop and wait for next input?
« on: August 18, 2014, 09:27:19 AM »
Im looking to pause for input in a loop. is this possible

Code: [Select]
   (if (> (length _list) 1)
(progn
(while _list
(alert "do my thing")
  (setq lista (cons list lista))
  (setq listb (cons list listb))
  (setq _list (remitem _list 0))  ; function to remove item from list
  (setq list (getstring))  ;wait for new input here
)
)
)

andrew_nao

  • Guest
Re: is it possible to pause in a loop and wait for next input?
« Reply #1 on: August 18, 2014, 09:38:02 AM »
i guess its kinda stupid to pause a loop why loop if you need to pause right?

reltro

  • Guest
Re: is it possible to pause in a loop and wait for next input?
« Reply #2 on: August 18, 2014, 01:46:52 PM »
Sure its possible...

I'm not sure why our code does not pause...
did not tested it, because u should not assign a value to a variable named list, maybe one of the most important function in lisp...

try:
Code - Auto/Visual Lisp: [Select]
  1. (while 'T (getstring "\na String: "))
  2.  

Greets reltro

andrew_nao

  • Guest
Re: is it possible to pause in a loop and wait for next input?
« Reply #3 on: August 18, 2014, 04:05:17 PM »
thank you for your help its appreciated
it was a typo was supposed to be _list thanks for the heads up