errtile Not Working Correctly

Discussion in 'AutoCAD' started by Scott, Dec 23, 2003.

  1. Scott

    Scott Guest

    Hi,

    I have a lisp routine, in it, the user picks a size from a list, upon
    pressing OK on the size dialog, the routine calls another routine. This
    second routine is responsible for ensuring that the user has selected a
    size. I use the errtile tag in my DCL file to output an error message to
    the dialog. I have this same setup throughout my routine, with the only
    difference being the name of the fitting. The size checking routine is
    called properly, and it does work, the dialog reappears if an invalid size
    is chosen. The only trouble is that I do not have the message displayed on
    the dialog box. Here is the size checking routine:

    (defun numcheck ()
    (if (or (= number 0) (= number nil))
    (progn
    (setq runner 0)
    (set_tile "error" "Invalid Size")
    )
    (progn
    (setq runner 1)
    (done_dialog)
    )
    )
    )

    Are there any obvious errors?

    TIA

    Scott
     
    Scott, Dec 23, 2003
    #1
  2. Scott

    Rudy Tovar Guest

    Not without reading the entire code.

    I'm not seeing the whole picture nor the main dialog.
     
    Rudy Tovar, Dec 23, 2003
    #2
  3. Scott

    Scott Guest

    I found the problem, it seems that, because of the way things are done with
    setting the size, number, the variable that numcheck checks is always
    nonzero.

    I know a way that it can be fixed, the trouble is can I do this? This
    routine works by, having the user select a size from the list box in the
    dialog, pressing OK on the dialog box sets the index number of the selected
    size to the variable number. So if the user chose the first size in the
    list box number = "0", number is converted from a string to a real, then 1
    is added to number. So number now = 1 From that, using a conditional
    statement, I set another variable called rodia# equal to another variable,
    in this case ar1#, where the the 1 is number. So say the user choose the
    4th size, number would be set to 5 and then rodia# would be set to ar5#.

    The ar[]# variables are (in lisp):

    (setq ar3# 4.00)

    (action_tile "reddia" "(setq number $value)")
    ;reddia is a listbox in the dialog, and number is it's index value
    ;Other bits of the reduce dialog here;

    ;** Assume that, for this example the user choose the second size down in
    the list **;
    So number is set to "2"

    (setq number (atof number))
    (setq number2 (rtos (+ 1 number) 2 0))
    (setq thevar (strcat "ar" number2 "#"))

    Now thevar = "ar3#"

    (setq rodia# thevar)

    Hopefully you can see what I am trying to do, I want to set rodia# to the
    predefined variable ar3# or = 4.00, but rodia# will = "ar3#" is there a way
    to make this work, so that I can use a variable to call a variable?

    Thanks Scott
     
    Scott, Dec 23, 2003
    #3
  4. Scott

    Rudy Tovar Guest

    Sorry for not getting back to you sooner Scott.

    I didn't have a chance to review the methods you've provided.

    And I really need to see the dialog and complete code.

    I understand if you don't want to post this, so I you'd like please email it
    to me directly.

     
    Rudy Tovar, Dec 24, 2003
    #4
  5. Scott

    Rudy Tovar Guest

    I hope I followed you correctly

    (action_tile "list1" "(return_list_value)")

    (defun return_list_value (/ val)
    (setq val (1+ (atoi $value)))
    (cond
    ((= val 1)(Do_this))
    ((= val 2)(Do_that))
    )
    (princ)
    )
    ;;In either case you don't have to add a one, just a condition.
    --

    AUTODESK
    Authorized Developer
    www.Cadentity.com
    MASi



     
    Rudy Tovar, Dec 24, 2003
    #5
  6. Scott

    Scott Guest

    Thank you for your input, I just realized that I was doing the error
    checking before I had set any values!

    Thanks,
    Scott

     
    Scott, Jan 9, 2004
    #6
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.