I'm just working out how to get the newLISP version number.
How does (sys-info 6) work? Are there always 4 digits, and is the point release always two digits? What happens when version 10 comes?
At present, it returns 9015, which is quite easy to resolve to 9.0.15. What did it say for 9.0.9 - 909 or 9009? How do you tell the difference between 9.11.0 and 9.1.10?
The manual retains a dignified silence on these vital issues ... :-)
getting the newLISP version number: (sys-info 6)
-
- Posts: 2038
- Joined: Tue Nov 29, 2005 8:28 pm
- Location: latiitude 50N longitude 3W
- Contact:
-
- Posts: 2038
- Joined: Tue Nov 29, 2005 8:28 pm
- Location: latiitude 50N longitude 3W
- Contact:
Ah! Thanks - so you reckon this might do the trick for the next few versions:
Code: Select all
(set 'version-string (string (sys-info 6)))
(set 'dev-version (pop version-string -2)) ; last two digits
(set 'point-version (pop version-string -1)) ; one digit
(set 'version version-string) ; what's left
(println version "." point-version "." dev-version)
-
- Posts: 2038
- Joined: Tue Nov 29, 2005 8:28 pm
- Location: latiitude 50N longitude 3W
- Contact:
This is better:
Code: Select all
(set 'version-string (string (sys-info 6)))
(set 'dev-version (pop version-string -2 2)) ; last two digits
(set 'point-version (pop version-string -1)) ; one digit
(set 'version version-string) ; what's left
(println version "." point-version "." dev-version)
... and here is another solution:
Lutz
Code: Select all
(let (v (string (sys-info 6)))
(append (chop v 3) "." (v 1) "." (-2 v)))
=> "9.0.18"