TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: BazzaCAD on June 22, 2007, 07:43:35 PM
-
OK, so I'm reading in a .txt file, and of course everything comes in as a string.
Let's say I have ("abc" "123" "1.5")...
How do I leave the "abc" as a string, convert the "123" to an Int, & convert the "1.5" to a Float?
thx,
Barry
-
Hi Barry.
perhaps something like ..
(setq
varlist (list "abc" "123" "1.5")
newlist '()
)
(FOREACH var varlist
(SETQ newlist (CONS (IF (DISTOF var)
(READ var)
var
)
newlist
)
)
)
(setq newlist (reverse newlist))
-
Looking for another thread but found this one.
http://www.theswamp.org/index.php?topic=9780.msg125334#msg125334
-
One more.
http://www.theswamp.org/index.php?topic=3710.0
-
thx guys, works great...