- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've made an attempt at writing a LISP function which will display initials on a drawing.
So far I have this which when I run, gives me an error:
(defun C:initials ( / init initial)
(setq init (Sparser (strcase(getvar "loginname")) "."))
(if (init)
(setq initial (strcat (substr (nth 0 init) 1 1) (substr (nth 1 init) 1 1)))
(setq initial "UNKNOWN")
)
initial
)
;run code
(C:initials)
; error: bad function: ("Bob" "Deblaise")
_$
The idea is that the login name is put in to a variable and tested to ensure it is not blank. If there is a login name, then it the name is split and the first letters of the first and second elements are concatenated and returned from the function.
Does anyone have any ideas as to what is causing the bad function error?
Thanks
Solved! Go to Solution.