lisp2arx
Visual Programming for AutoLisp Mathématiques en programmation Lisp.. doc2cpp,doc2lsp, sld2lsp, bmp2dcl, free__GifCcapture for all-CAD'platforms..
Lista Forumurilor Pe Tematici
lisp2arx | Reguli | Inregistrare | Login

POZE LISP2ARX

Nu sunteti logat.
Nou pe simpatie:
monaahmed2012 pe Simpatie.ro
Femeie
25 ani
Calarasi
cauta Barbat
25 - 46 ani
lisp2arx / Listof AutoLisp.100 / vla-AutoLispR14- Set Var inside VLisp (Like Variabile) Moderat de zauchan
Autor
Mesaj Pagini: 1
zauchan
Moderator

Inregistrat: acum 12 ani
Postari: 180
AutoLISP/XLISP 2.0 migration and cross-language programming
        utilities.
; AXLISP.LSP   Copyright 1990,91,92    Tony Tanzillo  All Rights Reserved

Code:

(defun increment (sym) (set sym (1+ (eval sym))) )
And it would have to be called thusly:
 (setq x 0) 
  (increment (quote x))
 Or just:
   (increment 'x)

; Examples of such are (setq), which does not evaluate its first, third,
; and all other odd-positioned arguments; (defun), which does not evaluate
; any of its arguments; (and), which does not evaluate any arguments that
; follow the first one that evaluates to nil.

Code:

Have you ever looked at the ACAD14.CFG (Autocad Configuration) file?

(setcfg "appdata/test/bolt" "M24")
(setcfg "appdata/test/length "90")
After (setcfg must come "appdata" followed by your application name, which must be unique. Following this is the variable tag and then the information you wish to store. If you open the ACAD14.CFG file, this is what the [AppData] section will look like :

{AppData/test}
bolt=4
length=90
To retrieve this data you would use the following syntax :
(setq a (getcfg "appdata/test/bolt"))
(setq b (getcfg "appdata/test/length"))
This would set a to "M24" and b to "90". Now this is great, I hear you say, but were would you use it. Here's a good example for you :
;Sub-function
 
(defun register ()
    (setq v1 (getcfg "AppData/CadKen/test"))
           (if (= v1 nil)
             (progn
                 (setcfg "AppData/CadKen/test" "1")
                 (setq v1 (getcfg "AppData/CadKen/test"))
             );progn
           );if
        (setq v2 5)
        (setq v1 (atoi v1))
           (if (< v1 v2)
             (progn
                (setq v1 (+ v1 1))
              (cond
                 ((= v1 1)  (setcfg "AppData/CadKen/test" "1"))
             ((= v1 2)  (setcfg "AppData/CadKen/test" "2"))
             ((= v1 3)  (setcfg "AppData/CadKen/test" "3"))
             ((= v1 4)  (setcfg "AppData/CadKen/test" "4"))
             ((= v1 5)  (setcfg "AppData/CadKen/test" "5"))
                 );cond
                 (setq v3 v1)
                 (setq v3 (rtos (- v2 v1)))
                 (alert (strcat "\n You Have " v3 " more Loadings Left"))
          (setq flagset T)  
             );progn
        (progn
               (alert "\nEvalution Period has Expired
                   \n   Contact Kenny Ramage
                   \n       
                   \n     For Licensed Copy")
        (setq flagset nil)
        );progn
         );if
    (princ)    
);defun
(princ)

; A simple example of a macro, is a function that accepts a symbol and then
; increments the value assigned to the symbol and returns its value after
; it has been incremented.  In order to do this, the calling function must
; receive the symbol, rather than its value. In AutoLISP here's how it would
; have to be done:

Code:

Excerpt from Acad 2013 'AutoLISP Developer's Guide' (the last pdf version) pp. 10

Symbols and Variables
AutoLISP uses symbols to refer to data. Symbol names are not case sensitive
and may consist of any sequence of alphanumeric and notation characters,
except the following:
Characters restricted from symbol names
( (Open Parenthesis)
) (Close Parenthesis)
. (Period)
' (Apostrophe)
" (Quote Symbol)
; (Semicolon)
A symbol name cannot consist only of numeric characters



_______________________________________
psw: cea de la wjndowsXP gigabyte..

pus acum 2 ani
   
Pagini: 1  

Mergi la