How to return to beginning

Discussion in 'AutoCAD' started by Adesu, Feb 15, 2005.

  1. Adesu

    Adesu Guest

    I mean if user hit "enter',I want return to beginning the program,here my
    script

    (prompt "\nSelect a (T)ext ot (L)ine to move it")
    (initget " T L")
    (setq opt (getkword "\nWHAT DO YOU WANT TO MOVE IT <T or L>; "))
    (setq hit "")
    (if opt (= opt hit)(alert "\nPlease try again,choose one"))
     
    Adesu, Feb 15, 2005
    #1
  2. Adesu

    Alaspher Guest

    You may "Prevent the user from responding to the request by entering only ENTER" (text from help):
    Code:
    (prompt "\nSelect a (T)ext or (L)ine to move it")
    (initget 1 "Text Line")
    (setq opt (getkword "\nWHAT DO YOU WANT TO MOVE IT [Text/Line]: "))
    but better way is to make default value:
    Code:
    (prompt "\nSelect a (T)ext or (L)ine to move it")
    (initget "Text Line")
    (if (not (setq opt (getkword "\nWHAT DO YOU WANT TO MOVE IT [Text/Line] <Text>: ")))
    (setq opt "Text")
    )
    Best regards!
     
    Alaspher, Feb 15, 2005
    #2
  3. Adesu

    Adesu Guest

    Hi Alaspher, this perfect by (initget 1 "Text Line"),thanks a lot.

     
    Adesu, Feb 15, 2005
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.