Bear31831 Posted February 6, 2009 Posted February 6, 2009 This may seem basic, but I am having a problem getting a simple lisp routine to accept a default value. when I enter the following code: (setq dst1 (getdist "\nEnter Post to Post spacing : ")) and accept the default, I get the response: ; error: bad argument type: numberp: nil What am I doing wrong? I know it's got to be simple, but I can't seem to find any reference to accepting a default value anywhere. By the way, I am new at this. Did you notice? Thanks, Joe B. Quote
The Buzzard Posted February 6, 2009 Posted February 6, 2009 (setq dst1 "5'4.5") After the defining of the function Quote
lpseifert Posted February 6, 2009 Posted February 6, 2009 you could try this, input needs to be in inches (if (null dst) (setq dst 64.5) );if (setq dst1 (getdist (strcat "\nEnter Post to Post spacing : <" (rtos dst 3 1) ">: ")) );setq (if (not dst1) (setq dst1 dst) (setq dst dst1) );if Quote
CAB Posted February 6, 2009 Posted February 6, 2009 Here is my version: (or dst (setq dst 64.5)) ; set default (and (setq ans (getdist (strcat "\nEnter Post to Post spacing : <" (rtos dst 3 1) ">: "))) (setq dst ans) ) Quote
Bear31831 Posted February 6, 2009 Author Posted February 6, 2009 Thank guys... I keep thinking life is simple. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.