Jump to content

Printing a variable to the command line??


Recommended Posts

Posted

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?

Posted

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 :)

Posted

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.:D

Posted

No Probs Hard Eight, I'm sure you'll get the hang of it - the hardest part is remembering which commands do what :P

Posted

i just have have trouble remembering

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...