本帖最后由 自贡黄明儒 于 2013-10-10 15:02 编辑
;;[功能] 倒置字符串
;;示例(HH:StrReverse "明经cad");返回"dac经明"
- (defun HH:StrReverse (stri / STR)
- (setq str(VL-PRIN1-TO-STRING stri))
- (setq str (strcat "Dim ret \n ret=StrReverse(" str ") "))
- (or *wscript*
- (setq *wscript* (vlax-create-object "ScriptControl"))
- )
- (vlax-put *wscript* 'language "vbs")
- (vlax-invoke-method *wscript* 'ExecuteStatement str)
- (vlax-invoke-method *wscript* 'eval "ret")
- )
|