Author Topic: How to check this value True or False?  (Read 161 times)

0 Members and 1 Guest are viewing this topic.

d2010

  • Newt
  • Posts: 52
How to check this value True or False?
« on: June 22, 2020, 08:16:23 AM »
Can you replace  ##err with code-lisp?
Code: [Select]
(setq ;|a41343|;
       rr (if_try10 "C063dfn_dcl_onesel2" (list a b))
     )
(if (= rr ##err) (princ "You got this error=#<%catch-all-apply-error%>\nPlease you fix here."))
:idiot2:
LTSCALE=1.0
; 1252 forms loaded from #<editor "C:/vlaxcompil/0user/pp_topoxcad.lsp">
_$ (c:q2)


_1_$
; error: bad argument type: consp #<%catch-all-apply-error%>

kpblc

  • Bull Frog
  • Posts: 357
Re: How to check this value True or False?
« Reply #1 on: June 22, 2020, 10:23:04 AM »
Do you mean something like this?
Code - Auto/Visual Lisp: [Select]
  1. ;; (setq ;|a41343|; rr (if_try10 "C063dfn_dcl_onesel2" (list a b)))
  2.       (setq rr (vl-catch-all-apply (function (lambda () (if_try10 "C063dfn_dcl_onesel2" (list a b))))))
  3.     ) ;_ end of vl-catch-all-error-p
  4.   (princ (strcat "\nYou got this error=#" (vl-catch-all-error-message rr) "\nPlease you fix here."))
  5. ) ;_ end of if
« Last Edit: June 22, 2020, 12:55:15 PM by kpblc »
Sorry for my English.

d2010

  • Newt
  • Posts: 52
Re: How to check this value True or False?
« Reply #2 on: June 22, 2020, 11:33:39 AM »
Do you something like this? You compare between two sources.
Code: [Select]
(defun str_pathtemp ( / rr e f k)  (asserte "A131")
(setq rr nil f (if_try11 "0x975D" (list  (if_try11 "0xE12A" (list  "TEMP"))))) (if (and  (not rr) f) (setq rr f)) (setq f (if (not f) (if_try11 "0x975D" (list
 (if_try11 "0xE12A" (list  "TMP")))) f)) (if (and  (not rr) f) (setq rr f)) (setq f
(if_try11 "0x975D" (list  (if_try11 "0x4E37" (list  "TEMPPREFIX")))) f (if (not f) (if_try11 "0x975D" (list  (if_try11 "0xE12A" (list  "TMP")))) f)) (setq f (if_try11 "0x975D" (list  (if_try11 "0x4E37" (list  "XLOADPATH"))))
f (if (not f) (if_try11 "0x975D" (list  (if_try11 "0xE12A"
(list  "TMP")))) f)) (if (=  rr nil) (setq rr "")) (setq k (strlen rr)) (if (>  k 2) (progn
(while (and  (>  k 1) (=  (if_try11 "0xF2C4" (list  rr k 1)) " ")) (setq rr (if_try11 "0xF2C4" (list  rr 1 (- k 1))))) (progn  (while (and  (>  k 1) (if_try11 "0x46CA" (list  rr "*[\\]*"))) (if (=  (if_try11 "0xF2C4" (list  rr k 1)) "\\")
(setq rr (if_try11 "0x31AB" (list  (if_try11 "0xF2C4" (list  rr 1 (- k 1))) "/" (if_try11 "0xF2C4" (list  rr (+ k 1))))))) (setq k (- k 1)))) (setq c (if_try11 "0xF2C4" (list  rr (strlen rr)))) (if (/= c "/") (setq rr (if_try11 "0x31AB" (list  rr "/")))))) rr)

Which Defun is the Best source?Eu am codificat (encode) sursa-Visual, Eu am dorit intoarcerea codului sursa Visual-Lisp la cod-binar(eng. pcode-bin).
Adica noi putem incerca un nou nivel de sursa pcode-bin, inside ascii dar, acest nou nivel de sursa p-code, sa poata fii compilat la format .Vlx sau .Fas cu ajutorul tools-ului Vlide sau VBlade din BrisC*d.
Dvs doriti criptarea sirurilor string (pcode-str)?
{e.g. (getvar "TEMPPREFIX") , eu voi inlocui (getvar (stq "0#5ASD")) }
Code: [Select]
(defun str_pathtemp ( / rr e f k)  (asserte "A131")
   (setq rr nil f (dfn_var_isstr (getenv "TEMP"))) (if (and  (not rr) f) (setq rr f)) (setq f (if (not f)
(dfn_var_isstr (getenv "TMP")) f)) (if (and  (not rr) f)
(setq rr f)) (setq f (dfn_var_isstr (getvar "TEMPPREFIX")) f (if (not f) (dfn_var_isstr (getenv "TMP")) f))
 (setq f (dfn_var_isstr (getvar "XLOADPATH")) f (if (not f) (dfn_var_isstr (getenv "TMP")) f)) (if (=  rr nil) (setq rr ""))
(setq k (strlen rr)) (if (>  k 2) (progn (while (and  (>  k 1) (=  (substr rr k 1) " ")) (setq rr (substr rr 1 (- k 1))))
(progn  (while (and  (>  k 1) (wcmatch rr "*[\\]*")) (if (=  (substr rr k 1) "\\")
(setq rr (strcat (substr rr 1 (- k 1)) "/" (substr rr (+ k 1))))) (setq k (- k 1)))) (setq c (substr rr (strlen rr))) (if (/= c "/") (setq rr (strcat rr "/"))))) rr)

« Last Edit: June 22, 2020, 11:54:51 AM by d2010 »

kpblc

  • Bull Frog
  • Posts: 357
Re: How to check this value True or False?
« Reply #3 on: June 22, 2020, 01:11:13 PM »
Look at my sign: english is not my native language.
Secodary. Если я ща начну по русски тут общаться, меня гарантированно мало кто поймет. А оно мене надо?
Third. Both codes are unreadable for me. My ACAD doesn't know anything about functions named asserte, if_try11, dfn_var_isstr. So I can't get what code should do.
Anyway you can change
Code - Auto/Visual Lisp: [Select]
  1. (setq rr nil
  2.         f  (dfn_var_isstr (getenv "TEMP"))
  3.   ) ;_ end of setq
  4.   (if (and (not rr) f)
  5.     (setq rr f)
  6.   ) ;_ end of if
  7.   (setq f (if (not f)
  8.             (dfn_var_isstr (getenv "TMP"))
  9.             f
  10.           ) ;_ end of if
  11.   )
to
Code - Auto/Visual Lisp: [Select]
  1.   (setq f (cond ((dfn_var_isstr (getenv "TEMP")))
  2.                 (t (dfn_var_isstr (getenv "TMP")))
  3.           ) ;_ end of cond
  4.   ) ;_ end of setq
I can't check how it will works - but as an idea ))
« Last Edit: June 22, 2020, 01:31:42 PM by kpblc »
Sorry for my English.