if Handle(GetApplication()) <> 0 then
//运行状态
//取路径
ls_path = Space (128)
li_rtn = GetModuleFileNameA (Handle (GetApplication ()), ls_path, 128)
// 调用此函数需要声明以下外部函数
// Get Runtime Path
// Function uLong GetModuleFileNameA(long hinstModule, Ref String lpszPath, uLong cchPath) Library "kernel32.dll"
//
// 该函数返回的是运行文件名(所以必须判断运行模式),需要自己找出路径
integer i
for i = len(ls_path) to 1 step -1
if mid(ls_path,i,1) = '\' then
goto jumpout
end if
next
jumpout:
// 不知道怎么从循环中跳出来,只好用goto了
ls_path = left(ls_path,i - 1)
ls_path = ls_path + '\'