值得一提的是,Visual LISP(vl bt)函数将执行类似的回溯:
(defun c:test ( / *error* a b c d )
(setq *error* '(( m ) (vl-bt)))
(setq a
(setq b
(setq c
(setq d (/ 1.0 0))
)
)
)
)
Command: test Backtrace:
(VL-BT)
(#<SUBR @000000002c5dc610 -lambda-> "divide by zero")
(ill-fun-hk "divide by zero")
(((M) (VL-BT)) "divide by zero")
(_call-err-hook ((M) (VL-BT)) "divide by zero")
(sys-error "divide by zero")
:ERROR-BREAK.29 "divide by zero"
(/ 1.0 0)
(C:TEST) LAP+28
(#<SUBR @000000002c5dc5e8 -rts_top->)
(#<SUBR @000000002c598700 veval-str-body> "(C:TEST)" T #<FILE internal>)
:CALLBACK-ENTRY.6 (:CALLBACK-ENTRY)
:ARQ-SUBR-CALLBACK.3 (nil 0) 李,
是的,我试了一段时间,但我发现它从有点神秘到非常神秘。
旧版本的主要缺点是“错误:参数类型错误”
它不会告诉你呼叫期望的是什么
只是这不正确。
我一直觉得errno应该被扩展和/或允许成熟为一个强大的已知错误列表。
-大卫
顺便说一句,我试过Notepad++,但效果并不好。我发现它不是一个真正的ASCII编辑器,因为它定期保留制表符。 有机会分享吗?
我有大约5年的ACAD经验,3年的lisp使用经验和几个月的lisp代码编写实践,当我读到你关于2000年的帖子时,我感觉自己完全是个新手。
我对编程相当陌生(因为我开始对每次在论坛上要求一个完整的例程感到难过),所以如果可能的话,我会尽量减少这类帖子的数量。
现在我练习我的格式化和调试技能,但这些当然会带来更多的额外问题。
很抱歉这些离题帖子。
N++将保留已经存在的制表符,但它也提供了在“编辑>空白操作>制表符到空格”下将其转换为空格的选项。
您可以通过转到“设置”>“首选项”>“选项卡设置”>“默认设置”避免在编写代码时插入选项卡,并确保选中“按空格替换”。
我似乎记得几年前大卫在这里发布了这个惯例;或者,这里是几年前的一个类似例程。 李,
我以前见过!
也许现在是我尝试的时候了。但我仍然要问,是否可以配置样式列表以增加括号?我的意思是这样的:
'(
("" "[/ code]" );; Container
("" "[/ color]");; Quotes/Dots
("" "[/ color]");; 1st level Brackets
("" "[/ color]");; 2nd level Brackets
("" "[/ color]");; 3rd level Brackets
("" "[/ color]");; 4th level Brackets
("" "[/ color]");; Multiline Comments
("" "[/ color]");; Single Comments
("" "[/ color]");; Strings
("" "[/ color]");; Protected Symbols
("" "[/ color]");; Integers
("" "[/ color]");; Reals
)
至于其他讨论,我发现N++在使用按折叠缩进插件进行格式化时非常灵活。我还看到了一个
一个俄罗斯人自动将新修改的代码从N++重新加载到ACAD(就像VLIDE的控制台一样)-我不知道他是怎么做到的。 不使用当前代码,但可以修改程序以适应此功能。 你可以把它看作一个想法。
编辑:
我已经开始检查了——参数、变量和括号的数量让我震惊。 我猜LSP2HTML始于2001年。LSP2BBC 2005和2009年修改。
只是提醒一下,这只适用于论坛消息区域。
作为一个测试,看看什么测试。lsp转换为html格式,如下所示
<PRE><TT><FONT COLOR="FFFFFF">
<FONT COLOR="FFFFFF"> 1| </FONT>(</FONT><FONT COLOR="FF9900">defun</FONT> </FONT><FONT COLOR="FFFFFF">c:test </FONT><FONT COLOR="FF00FF">()
<FONT COLOR="FF00FF"> 2| </FONT>(</FONT><FONT COLOR="FF9900">setq</FONT> </FONT><FONT COLOR="FFFFFF">*error* nil</FONT><FONT COLOR="FF00FF">)
<FONT COLOR="FF00FF"> 3| </FONT>(</FONT><FONT COLOR="FF9900">setq</FONT> </FONT><FONT COLOR="FFFFFF">a
<FONT COLOR="0000FF"> 4| </FONT> </FONT><FONT COLOR="0000FF">(</FONT><FONT COLOR="FF9900">setq</FONT> </FONT><FONT COLOR="FFFFFF">b
<FONT COLOR="00FFFF"> 5| </FONT> </FONT><FONT COLOR="00FFFF">(</FONT><FONT COLOR="FF9900">setq</FONT> </FONT><FONT COLOR="FFFFFF">c
<FONT COLOR="00FF00"> 6| </FONT> </FONT><FONT COLOR="00FF00">(</FONT><FONT COLOR="FF9900">setq</FONT> </FONT><FONT COLOR="FFFFFF">d </FONT><FONT COLOR="FFFF00">(</FONT><FONT COLOR="FF9900">substr</FONT> </FONT><FONT COLOR="FFFFFF">1 1 1</FONT><FONT COLOR="FFFF00">)</FONT><FONT COLOR="00FF00">)</FONT><FONT COLOR="00FFFF">)</FONT><FONT COLOR="0000FF">)</FONT><FONT COLOR="FF00FF">)
<FONT COLOR="FF00FF"> 7| </FONT></FONT><FONT COLOR="FFFFFF">)
</FONT></PRE></TT>
-大卫
LSP2BBC。LSP
谢谢我想它就在那里,只是没找到。N++的对等社区(Gitter)相当弱。
谢谢-大卫 大卫,
这东西太棒了,非常感谢!
我刚刚在我之前的示例中进行了测试:
(if
(and ; Evaluate arguments from user within the "and" function
(if
(not (Stuff to do #1 ))
(princ "\nTheres something wrong in #1 try again!")
(Stuff to do #1 )
)
(if
(not (Stuff to do #2 ))
(princ "\nTheres something wrong in #2 try again!")
(Stuff to do #2 )
)
(if
(not (Stuff to do #3 ))
(princ "\nTheres something wrong in #3 try again!")
(Stuff to do #3 )
)
); All arguments are evaluated, the code proceeds
(while somethingisdone ; example: a selection was made and the same must be copied or moved within the while loop
(progn
(while
(not (setq pickline (entsel "\nPick a line")))
pickline
(cond
( (= 7 (getvar 'errno))
(princ "\nYou must select a line.")
)
( (null pickline)
(princ "\nYou missed, try again.")
)
)
); to exit this loop and continue a line must be picked
(We got everything we need from Stuff #1, #2 and #3, now the code does its job... )
); the code did its job, exiting with my favourite ESC key, and don't forget the error handling if needed!
)
);if
我不认为有了这种格式,它可以得到任何进一步!
页:
1
[2]