Alan yours worked fine.
Lee, I loaded yours and tried to run it but it failed, saying "the operation has been cancelled". Probably just missing a parentheses or something? All works fine for me Rod.
Bear in mind that mine and Alan's share a global that is of different data type in each case, so don't test one after the other.
Open a new drawing before testing mine/his.
Much nicer. However, I think you'll have problems if you hit enter at the getstring prompt since it will return "" instead of nil.
Maybe something like this...
(setq gStr (lambda (/ s) (if (eq "" (setq s (getstring (strcat "\nSpecify Starting Number: "))) ) ;_ eq *start s ) ;_ if ) ;_ lambda ) ;_ setq
Type: (setq *start nil) then test.
I wasn't thinking broad enough. Mine would only correct something like 6 to 06 but ignore something like 006. Good point about the getstring - that construct was a remnant of the getint prompt... - code updated. Ok, I tried it in a new drawing and discovered two problems.
As Alan stated, if you hit enter at the command prompt, nothing happens. It won't accept the default shown in brackets. And also, once you get to 09, if you click on the next block in succession, it won't change to 10, it just stops working. Ok, the updated code fixed the first problem of hitting enter at the command prompt, but the second problem still exists. You can't continue auto-numbering past 09. The routine just quits. Another silly mistake- cheers Rod - I think I kinda rushed this one...
Code updated. Ok, it's working now. Thanks again for your help.
Glad we got there in the end... can't believe the amount of mistakes in my first code... unbelieveable
页:
1
[2]