|
用VFP 9.0 基本做好了一个软件,可是放到其他的目录下就无法运行,提示无效路径或文件名!
DECLARE INTEGER FindWindow IN WIN32API STRING,STRING
LOCAL cTitle
cTitle="-系统-"
IF FindWindow(0,cTitle)<>0
=MESSAGEBOX("该系统已运行,无需重复!",48,"错误信息")
QUIT
ENDIF
CLEAR SCREEN
CLEAR
CLOSE ALL
CLEAR ALL
SET TALK OFF
SET SYSMENU OFF
SET SYSMENU TO
SET TALK OFF
SET STEP OFF
SET ECHO OFF
SET SAFETY OFF
SET DELETED ON
SET OPTIMIZE ON
SET CENTURY ON
SET DATE TO ANSI
SET MARK TO "-"
_screen.caption="系统"
ON ERROR DO errhand WITH ERROR(),MESSAGE(),MESSAGE(1),PROGRAM(),LINENO()
RELEASE WINDOW
RELEASE WINDOW
mypath=SYS(5)+SYS(2003)
set DEFA TO &mypath
set path to &mypath
DO form 系统登陆
READ EVENTS
close all
clear all
QUIT
PROCEDURE errhand &&错误检测
PARAMETER merror,MESS,mess1,mprog,mlineno
=MESSAGEBOX("错误代码:"+LTRIM(STR(merror))+", 错误信息:"+MESS+" 错误代码串:"+mess1+", 错误行号:"+LTRIM(STR(mlineno))+", 出错程序名:"+mprog +" 按确定后退出系统!请重新运行!!")
QUIT
RETURN |
|