sequential numbers

I am writing a lisp routine where I'm trying to get balloons numbered/lettered sequentially, mostly, but sometimes out of sequence. The first time through the routine you will always be prompted for a "grid mark" and on subsequent passes you will be able to either choose the next one sequentially or to start a new sequence from there. This is the subroutine I am using. There are repeated calls to this routine until the user quits the program. In the initial loading of the program count has been set (setq count 0). It seems to not work however. What am I doing wrong please?

(defun balloonstring () (setq count (+ count 1)) ;setq count (if (> count 1) (progn (setq balloontext (chr (+ 1 (ascii balloontext))) promptstring (strcat "\nballoontext ") newstring (getstring promptstring) ) ;setq balloon (if (/= newstring "") (progn (setq balloontext newstring)) ;progn ) ;if newstring ) ;progn ) ;if count (if (= count 1) (progn (setq newstring (getstring "\nEnter ballon text")) ;setq (setq balloontext newstring) ) ;progn ) ;if count )

Reply to
Chuck
Loading thread data ...

I don't understand the question. The function you posted seems to work = (although going from 9 to : to ;, etc seems strange)

What is it not doing that it should, or what is it doing that it = shouldn't?

Reply to
R.K. McSwain

Ok, here's the whole story. It quits half way through the routine for some reason. It seemed to work ok until I added the subroutine I mentioned earlier.

(DEFUN setup () (SETQ OsOLD (GETVAR "OSMODE") TEXTOLD (GETVAR "TEXTSIZE") LAYROLD (GETVAR "CLAYER") ORTHOLD (GETVAR "ORTHOMODE") ) (setq count 0) (if (= (tblsearch "layer" "GRID") nil) (progn (command "-layer" "n" "GRID" "c" "2" "GRID" "lt" "CENTER" "GRID" "" ) ) ) (if (= (tblsearch "layer" "BALLOON") nil) (progn (command "-layer" "n" "BALLOON" "c" "2" "BALLOON" "lt" "CONTINUOUS" "BALLOON" "" ) ) ) ) (defun balloonstring () (setq count (+ count 1)) ;setq count (if (> count 1) (progn (setq balloontext (chr (+ 1 (ascii balloontext))) promptstring (strcat "\nballoontext ") newstring (getstring promptstring) ) ;setq balloon (if (/= newstring "") (progn (setq balloontext newstring)) ;progn ) ;if newstring ) ;progn ) ;if count (if (= count 1) (progn (setq newstring (getstring "\nEnter ballon text")) ;setq (setq balloontext newstring) ) ;progn ) ;if count ) ;defun

What is it not doing that it should, or what is it doing that it shouldn't?

Reply to
Chuck

I solved it me self...........thx

Reply to
Chuck

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.