if not lisp function

molokaiboy

Usenet Archive
Joined
Jul 15, 2003
Messages
83
Reaction score
0
I am trying to create a lisp that will load only if the "poweruser" user is trying to access a command. If all other users try to access the command, it will show a msg box and not load the rest of the code. Here is what I have:

(if (= (strcase (getvar "loginname")) "poweruser")
      (if (not (poweruser (load "msg3") ""))
(command msg3)

add error trap here

))

Can anyone give me some tips as to how I would finish it.

TIA

Collin
 
Is this what you are looking for?

(if (= (strcase (getvar "loginname")) "POWERUSER")
(progn
<do your stuff for the poweruser here>
)
;;person is not poweruser and gets this
(progn
(load "msg3")
(msg3)
)
)
molokaiboy said:
I am trying to create a lisp that will load only if the "poweruser" user
is trying to access a command. If all other users try to access the command, it will show a msg box and not load the rest of the code. Here is what I have:
 
yes, this is close to what I want but just having this still allows for the rest of the code to load right? If so, how do I prevent the rest of the code from loading?

TIA

Collin
 
I tried the code and it only loads the error message. I would like to have the error pop up only if the user is not equal to the "poweruser" login.

How do I do this?
TIA

Collin
 
Below is a copy of the code. Here is the error message that I get:

; error: no function definition: MSG3

(defun C:MSG3
(ALERT "Access Denied! See Your System Administrator") )
(princ)

(defun logincheck (/)
(if (= (strcase (getvar "loginname") t) "joe")
&nbsp;&nbsp;(progn
&nbsp;&nbsp;(load "insertreleased.lsp")
&nbsp;&nbsp;(insertreleased)
&nbsp;&nbsp;)
&nbsp;&nbsp;;;person is not joe and gets this

(progn

;(ALERT "Access Denied! See Your System Administrator") &nbsp;&nbsp;&nbsp;(load "MSG3") &nbsp;&nbsp;&nbsp;(MSG3) &nbsp;&nbsp;) ) &nbsp;&nbsp;(princ)
&nbsp;&nbsp;)
 

Latest threads

Back
Top