f_ljnc_get_path.srf 729 B

12345678910111213141516171819202122232425262728
  1. $PBExportHeader$f_ljnc_get_path.srf
  2. global type f_ljnc_get_path from function_object
  3. end type
  4. forward prototypes
  5. global function string f_ljnc_get_path ()
  6. end prototypes
  7. global function string f_ljnc_get_path ();String ls_Path, ls_Buffer = Space(255)
  8. If Handle(GetApplication(), False) = 0 Then
  9. //开发模式运行
  10. ls_Path = GetCurrentDirectory()
  11. Else
  12. //编译后运行
  13. If GetModuleFileName(Handle(GetApplication()),ls_Buffer,255) = 0 Then
  14. SetNull(ls_Buffer)
  15. ls_Path = ''
  16. Else
  17. ls_Buffer = Left(ls_Buffer,LastPos(ls_Buffer,"\"))
  18. ls_Path = Trim( ls_Buffer )
  19. End If
  20. End If
  21. If ls_path <> '' And Right(ls_path, 1) <> '\' Then ls_path += '\'
  22. Return ls_Path
  23. end function