Hardeight Posted January 19, 2009 Posted January 19, 2009 Is there a way to print the value of a variable to the command line? For instance, I am going through a loop and for each entity in my selection set I am inserting a new block with info from the other blocks that make up the selection set. But what I want to do is before every new block is inserted, change a variable but I have to prompt the user.... (setq Curquan (getstring "\n Enter quantity for part number"))...etc, etc, etc, I already have a "PNUM" variable that holds the current number I wish to show up on the command line but I cant figure out how to get it to print on a single line like I want it to. I want the command line output to be... "Enter quantity for part number 123456:" Any suggestions? Quote
Lee Mac Posted January 19, 2009 Posted January 19, 2009 If you are prompting for a "quantity" it is probably better to be using "getreal" or "getint". If you want to use your previously stored variable in the string: (setq Curquan (getstring (strcat "\nEnter quantity for part number" (rtos PNUM) ": "))) Hope this helps Quote
Hardeight Posted January 19, 2009 Author Posted January 19, 2009 LEE! The strcat function is exactly what I needed. Thanks for the tidbit. It seems like everyday I find something new in my programming that opens up all kinds of doors. My command is growing bigger everyday and as soon as I get it done I will post it to to share so maybe someone can get some help from me someday. Cheers. Quote
Lee Mac Posted January 19, 2009 Posted January 19, 2009 No Probs Hard Eight, I'm sure you'll get the hang of it - the hardest part is remembering which commands do what Quote
flowerrobot Posted January 20, 2009 Posted January 20, 2009 i just have have trouble remembering 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.