Jump to content

Recommended Posts

Posted (edited)

Hi I have this sub routine attached to a reactor, for recording my Acad session. The routine works fine except when I choose not to record the "Data Ignored" prompt does not come up, only the "Saving data" prompt comes up regardless of saving or not. Can anyone help me here.

 

NB" PLEASE DON'T BUST MY BALL I DON'T KNOW HOW TO INSERT MY CODE IN ITS CORRECT LOCATION; (someone coluld help that too)

 

 

Code;

(defun ActionToAnswer ( );;;Triggered Thiscommand

 (If (or (= ans "yes") (= ans Nil) (= ans "") (="y"))
    (progn (princ "\nSaving data....") 
               (diary)
    )
   (princ "\nData ignored....")
 )
)

Edited by SLW210
Add tag and bust ball
Posted

Please put [ code] at start and [ /code] at end of your code, or highlight then pick # icon in your editor Quick Reply

 

(defun ActionToAnswer ( );;;Triggered Thiscommand
(If (or (= ans "yes") (not ans) (= ans "") (= [color=red]ans[/color] "y")) ;[color=red]Put ans here, if only (= "y") => always return T, then you always do Saving data....[/color]
(progn (princ "\nSaving data....")
(diary)
)
(princ "\nData ignored....")
)
) 

Posted

Your function does not require "ans" as an argument, and is not defined within the function, thus will return T at = nil condition (if not globally defined elsewhere). You must define the variable, or supply as an argument.

Posted

... You wouldn't like SLW when he's angry. Just saying.

Posted
... You wouldn't like SLW when he's angry. Just saying.

 

Is not putting your code iin tags the only way to **** him off? Just curious. I'm still learning how to write code, so I've never run into that.

Posted
Is not putting your code iin tags the only way to **** him off? Just curious. I'm still learning how to write code, so I've never run into that.

 

Does it mean that you are running into two accounts ????:D

Posted
Is not putting your code iin tags the only way to **** him off? Just curious. I'm still learning how to write code, so I've never run into that.

 

Let's find out... "Show us your [code]!" :P

 

Being serious, everyone started somewhere when first learning to code; it takes serious work to "get good" at coding (that's why my skills are lacking! LoL). Mistakes are a given, correction(s) usually follow... Just learn from the experience. That's at least what I personally strive for... regardless of how poorly I live up to that expectation.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...