Results 1 to 4 of 4

Thread: Alert message does not display in while statement

  1. #1
    I could stop if I wanted to
    Join Date
    2003-11
    Posts
    277

    Default Alert message does not display in while statement

    Hi Alls,
    I have a simple code to check if a variable same as a target,then alert message would display,I just repeat test it,but always fail,any am I wrong?
    Code:
    (defun c:test (/ sdia hei)
      (setq sdia 25)
      (setq hei 21)
      (while
        (if
          (= hei (* sdia 0.8))
          (alert "\nTarget has finish")
          )                                              ; if
        (setq hei (- hei 0.1))
        )                                                ; while
      )                                                  ; defun

  2. #2
    Active Member ElpanovEvgeniy's Avatar
    Join Date
    2006-09
    Location
    Russia, Moscow
    Posts
    54

    Default Re: Alert message does not display in while statement

    Code:
    (defun c:test (/ sdia hei)
      (setq sdia 25)
      (setq hei 21)
      (while (if (equal hei (* sdia 0.8) 0.01)
               (alert "\nTarget has finish")
               (setq hei (- hei 0.1))
             ) ; if
      ) ; while
    )

  3. #3
    All AUGI, all the time CAB2k's Avatar
    Join Date
    2002-12
    Location
    Brandon, Florida
    Posts
    687

    Default Re: Alert message does not display in while statement

    Code:
    (defun c:test (/ sdia hei)
      (setq sdia 25)
      (setq hei 21)
      (while (> hei (* sdia 0.8))
        (setq hei (- hei 0.1))
      )
      (alert "\nTarget has finish")
    )

  4. #4
    I could stop if I wanted to
    Join Date
    2003-11
    Posts
    277

    Default Re: Alert message does not display in while statement

    Hi elpanov,
    It's great,many thanks for you.

    Quote Originally Posted by elpanov
    Code:
    (defun c:test (/ sdia hei)
      (setq sdia 25)
      (setq hei 21)
      (while (if (equal hei (* sdia 0.8) 0.01)
               (alert "\nTarget has finish")
               (setq hei (- hei 0.1))
             ) ; if
      ) ; while
    )

Similar Threads

  1. Display Z Coordinate in an Alert Box?
    By vsheehan in forum AutoLISP
    Replies: 18
    Last Post: 2011-07-14, 06:54 PM
  2. Alert message box is suppressed
    By Tharwat in forum AutoLISP
    Replies: 13
    Last Post: 2010-07-12, 06:49 PM
  3. Replies: 5
    Last Post: 2008-11-20, 04:48 PM
  4. DB alert message
    By cwjean76 in forum Dynamic Blocks - Technical
    Replies: 1
    Last Post: 2008-03-26, 06:11 PM
  5. Display Error Message
    By kjgiant in forum Revit Architecture - General
    Replies: 3
    Last Post: 2004-11-03, 08:51 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •