Загрузка программы ruCAD
(defun ru-app-load (name / lsp_src version result _ru-app-load-lsp)
;; Загрузка приложения
;; name - короткое имя без пути и расширения
(defun _ru-app-load-lsp (name ext / lsp result)
(setq lsp (strcat (ru-file-app name) ext))
(if (findfile lsp)
(if
(equal (load lsp "Failed") "Failed")
(princ
(strcat
"
Программа
"
lsp
"
не может быть загружена! Возможно она испорчена!"
) ;_ end of strcat
) ;_ end of princ
(setq result t)
) ;_ end of IF
) ;_ end of if
result
) ;_ end of defun
(if *ru_previewhelp*
(ru-help-txt-view (ru-file-help (strcat "txt\" name ".txt"))
"О программе"
(if *ru_developer*
name
""
) ;_ end of if
(and *ru_developer* (ru-user-may-txt-hlp-edit))
) ;_ end of ru-dlg-view-txt-file
;;; Вариант с HTML- файлом
;;; (ru-help-view name (and *ru_developer* (ru-user-may-develop)))
;|
Вариант с Советами дня
(ru-dlg-tips
(ru-user-long-name)
"А знаете ли вы, что..."
(strcat (ru-dirs-get-local-app-data) "TipsOfDay\" name ".tips")
) ;_ end of ru-dlg-tips
|;
) ;_ end of if
(if (and *ru_developer*
(dos_isvlide)
) ;_ end of and
(progn
(setq lsp_src (ru-file-set-ext (ru-file-lsp name) ".lsp"))
(if (findfile lsp_src)
(ru-app-make-fas-file name)
(princ (strcat "
Не найден исходный текст " lsp_src "
"))
) ;_ end of if
) ;_ end of progn
) ;_ end of if
(setq result t)
(if (not (_ru-app-load-lsp name ".fas"))
(if (not (_ru-app-load-lsp name ".lsp"))
(progn
(ru-msg-alert
(strcat "Программа "
name
" не входит в состав комплекта '"
(ru-rucad-version)
"'"
) ;_ end of strcat
) ;_ end of ru-msg-alert
(setq result nil)
) ;_ end of progn
) ;_ end of if
) ;_ end of if
result
) ;_ end of defun