[Search tip detail and code files using keywords, tip number, author name, etc ]
    For tip to function correctly, you must ensure that the downloaded file name matches the file name
    displayed in the Rename File To field. Please rename downloaded files when necessary.
Increment and Decrement Functions
Tip# 2156 By Rodney Thomas On 01-Oct-2006
Rated By 1 users Downloaded : 425
Categories : Misc. User Tools, LISP Code Modules
Software type : AutoCAD
Rename File To : Tip2156: incdec.lsp
Routine adds C-like syntax to LISP programming by increasing or decreasing an integer value in the place given the symbol.

Increment and Decrement Functions (Tip #2156), revised by Rodney Thomas, is a set of new functions for LISP programmers who want C-like syntax. Rodney provides the functions '++ and '- which increases or decreases an integer value in the place given the symbol. For example, if you set the value of variable AA to 100 using (setq AA 100) you can use Rodney's routines as (++ 'AA) to add one to AA and then store the result back in AA. The quote mark is needed to pass the reference of the symbol. Thanks for a great tip that LISP programmers can use to see the dynamic power of the language.



Average Rating:

User comments