Well my first thougt would be to use entity handles, since you can increment them as hex numbers.
If I'm not mistaken the difference is that hex incrementing would allow you to truly iterate the database entity by entity (testing for null results where there are holes, and there are holes), which includes things like non-graphical objects (table entries, dictionaries etc.), whereas entnext iterates only graphical objects like lines, arcs, blocks, attributes ... so (and this is my point) the behavior of an iterator based on handles would not be the same as one based on enames (in this context).
OF course the HEX function is not defined and I do not have the time at the moment to do so...
I wrote the following fugly awhile ago to provide the ability to increment HUGE hex numbers, something the other hex incrementers I've seen will not do, as they temporarilly convert to an integer for the incrementation, and then back to hex for the result, meaning there is a ceiling of 2^30. It looks fugly but it does work (did the last time I tried it anyway) ... oh yea, forgive the coding, it really wasn't meant for public consumption; nominal comments to be found.
(defun hex++ ( hex / __put lst i j a b )
;;
;; Copyright © 2004 Michael Puckett
;;
(defun __put ( item position lst / i )
(setq i -1)
(mapcar
'(lambda (x)
(if (eq position (setq i (1+ i)))
item
x
)
)
lst
)
)
;;
;; main ...
;;
(setq lst
(cons
(1+
(car
(setq lst
(reverse
(vl-string->list
(strcase hex)
)
)
)
)
)
(cdr lst)
)
)
(setq i -1)
(while (setq a (nth (setq i (1+ i)) lst))
(cond
( (< 70 a) ;; "G" and greater
(setq lst
(if (setq b (nth (setq j (1+ i)) lst))
(__put (1+ b) j (__put 48 i lst))
(append (__put 48 i lst) (list 49))
)
)
)
( (eq 58 a) ;; ":"
(setq lst (__put 65 i lst)) ;; replace w/"A"
)
)
)
;;
;; return the fruit of our labours ...
;;
(vl-list->string (reverse lst))
)
Oh yeah, there is no hand holding, Hex++ expect you to provide a valid hex number as the sole argument. Passing anything else results in an undefined result.
(Hex++ "FFFFFFFFFFFFFFFF") ==> "10000000000000000"
And now for some fun.
Think you know lisp? What should this result be:
(abs (expt 2 31))
A really large postive integer right? lol, try it.
<hoping some portion of this post is useful>