Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

dificulty with While loop

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
299 Views, 3 Replies

dificulty with While loop

what I am trying to do is check the length of a string and if its not long enough add leading "0" until it is.

(while (< 3 (strlen wns)) (setq wns (strcat "0" wns)))

I'm sure that there's just one little thing that I am missing but I've looked at it to long already.
3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: Anonymous

change the less than sign to a greater than sign (stupid HTML formatting) Edited by: thatcadguy on Sep 23, 2009 3:25 PM
Message 3 of 4
Kent1Cooper
in reply to: Anonymous

Or, reverse the items in the less-than function:

(< (strlen wns) 3)

--
Kent Cooper
Kent Cooper, AIA
Message 4 of 4
Anonymous
in reply to: Anonymous

Thanks for the help!
I knew it had to be something simple. Edited by: dbauman2002 on Sep 24, 2009 8:35 AM

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


AutoCAD Beta