(vl-load-com)
(setq zcet_GetResStr_reslst nil)

(defun initRes(fname / ch f idx len macro pos)
  (setq zcet_GetResStr_reslst nil)
  (setq f (open fname "r"))
  (while (setq ch (read-line f))
    (setq len (strlen ch))
    (setq pos (vl-string-search " " ch))
    (if pos
      (progn
        (setq macro (substr ch 1 pos))
        (setq idx (vl-string-left-trim " " (substr ch (+ pos 1) (- len pos))))
        (setq idx (vl-catch-all-apply 'atoi (list idx)))
        (if (null (vl-catch-all-error-p idx))
          (setq zcet_GetResStr_reslst (cons (cons macro idx) zcet_GetResStr_reslst))
        )
      )
    )
  )
  (close f)
)

(defun zcet_GetResStr(macro defStr / fname id)
  (setq fname (strcat (vl-filename-directory (findfile "ZWCAD.exe")) "\\Express\\resource.dat"))
  (if (null zcet_GetResStr_reslst)
    (initRes fname)
  )
  
  (if (or (null zcet_GetResStr_reslst) (null getStringFromDLL))
    defStr
    (progn
      (setq id (assoc macro zcet_GetResStr_reslst))
      (if id
        (progn
          (setq id (cdr id))
          (getStringFromDLL id defStr)
        )
        defStr
      )
    )
  )
)

(defun zcet_SilentErr(msg)
  (setq *error* zcet_g_bkErr)
)

(defun zcet_SilentInit()
  (setq zcet_g_bkErr *error*)
  (setq *error* zcet_SilentErr)
)

(defun zcet_SilentUnInit()
  (setq *error* zcet_g_bkErr)
)

(princ)