home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Sams Cobol 24 Hours
/
Sams_Cobol_24_Hours.iso
/
Cobol32
/
PowerGEM
/
Powergem.z
/
F3BXCDBG.SCP
< prev
next >
Wrap
Text File
|
1995-10-08
|
5KB
|
224 lines
public :
var MyToolClass = "DEBUG" ;
var Status = "BUSY" ;
var Tool ;
var Debugger ;
var Filespec ;
var StartFlag = 0 ;
var StopFlag = 0 ;
exec() {
var Ret ;
Ret = MessageOpen(MyToolClass) ;
Filespec = MakeFilespec("*", 0) ;
Ret = MakeEvent("R",MyToolClass,"START", Filespec,"Start") ;
}
Terminate() {
var Ret ;
var ErrorDlg ;
if (StopFlag == 1) {
return (TRUE) ;
}
if (!IsNULL(Tool)) {
SCRIPT.ErrorDisplay = False ;
ErrorDlg = GetObjectID("Script compiler error", "CAPTION") ;
if (!IsNull(ErrorDlg)) {
CloseWindow(ErrorDlg) ;
ErrorDlg = GetObjectID("Script compiler error", "CAPTION") ;
if (!IsNull(ErrorDlg)) {
KeyBoard(ErrorDlg, "<ALT+N>") ;
}
}
ErrorDlg = GetObjectID("Script run error", "CAPTION") ;
if (!IsNull(ErrorDlg)) {
CloseWindow(ErrorDlg) ;
ErrorDlg = GetObjectID("Script run error", "CAPTION") ;
if (!IsNull(ErrorDlg)) {
KeyBoard(ErrorDlg, "<ALT+N>") ;
}
}
ErrorDlg = GetObjectID("Macro manager", "CAPTION") ;
if (!IsNull(ErrorDlg)) {
CloseWindow(ErrorDlg) ;
}
CloseWindow(Tool) ;
Wait(Tool) ;
Tool = NULL ;
SCRIPT.ErrorDisplay = True ;
}
Status = "NOTRUNNING" ;
Ret = MessageSend(MakeMessageID(), "N", MyToolClass, "STATUS",
Filespec,Status ) ;
Ret = MessageSend(MakeMessageID(), "N", MyToolClass, "STOP", Filespec) ;
StopFlag = 1 ;
MessageClose() ;
Close() ;
}
Start() {
var Ret ;
var Command ;
var Para ;
Filespec = MakeFilespec("*", 0) ;
Ret = DeleteEvent("R", MyToolClass, "START", Filespec) ;
if (StartFlag == 1) {
Ret = MessageSend(GetMessageID(), "F", MyToolClass, "START",
GetFilespec()) ;
return (TRUE) ;
}
Filespec = GetFilespec() ;
Command = "F3BXCMAC.EXE" ;
Para = FilespecToPathName(Filespec) ;
Tool = ToolExec(Command, formatstring("-e -d -i %s", Para), FALSE) ;
SCRIPT.ErrorDisplay = False ;
if (IsNULL(Tool)) {
SCRIPT.ErrorDisplay = True ;
Stop() ;
}
SCRIPT.ErrorDisplay = True ;
Status = "STARTING" ;
Ret = MessageSend(MakeMessageID(), "N", MyToolClass, "STATUS",
Filespec, Status) ;
Ret = MakeEvent("R", MyToolClass, "STATUS", Filespec, "Status") ;
Ret = MakeEvent("R", MyToolClass, "STOP", Filespec, "Stop" ) ;
Ret = MakeEvent("R", MyToolClass, "MAXIMIZE", Filespec, "Maximize") ;
Ret = MakeEvent("R", MyToolClass, "MINIMIZE", Filespec, "Minimize") ;
Ret = MakeEvent("R", MyToolClass, "NORMALIZE", Filespec, "Normalize") ;
Status = "READY" ;
Ret = MessageSend(MakeMessageID(), "N", MyToolClass, "STATUS",
Filespec, Status );
Ret = MessageSend(GetMessageID(), "N", MyToolClass, "START", Filespec) ;
StartFlag = 1 ;
StopFlag = 0 ;
return (TRUE) ;
}
Stop() {
var Ret ;
var ErrorDlg ;
Filespec = GetFilespec() ;
SCRIPT.ErrorDisplay = False ;
ErrorDlg = GetObjectID("Script compiler error", "CAPTION") ;
if (!IsNull(ErrorDlg)) {
CloseWindow(ErrorDlg) ;
ErrorDlg = GetObjectID("Script compiler error", "CAPTION") ;
if (!IsNull(ErrorDlg)) {
KeyBoard(ErrorDlg, "<ALT+N>") ;
}
}
ErrorDlg = GetObjectID("Script run error", "CAPTION") ;
if (!IsNull(ErrorDlg)) {
CloseWindow(ErrorDlg) ;
ErrorDlg = GetObjectID("Script run error", "CAPTION") ;
if (!IsNull(ErrorDlg)) {
KeyBoard(ErrorDlg, "<ALT+N>") ;
}
}
ErrorDlg = GetObjectID("Macro manager", "CAPTION") ;
if (!IsNull(ErrorDlg)) {
CloseWindow(ErrorDlg) ;
}
CloseWindow(Tool) ;
Wait(Tool) ;
Tool = NULL ;
SCRIPT.ErrorDisplay = True ;
Status = "NOTRUNNING" ;
Ret = MessageSend(MakeMessageID(), "N", MyToolClass, "STATUS",
Filespec,Status) ;
Ret = MessageSend(GetMessageID(), "N", MyToolClass, "STOP", Filespec) ;
MessageClose() ;
StopFlag = 1 ;
Close() ;
}
Status() {
var Ret ;
Filespec = GetFilespec() ;
Ret = MessageSend(GetMessageID(), "N", MyToolClass, "STATUS",
Filespec, Status );
return (TRUE) ;
}
Maximize() {
var Ret ;
Filespec = GetFilespec() ;
SCRIPT.ErrorDisplay = False ;
Debugger = GetObjectID("Script debugger","CAPTION") ;
if (!IsNULL(Debugger)) {
Ret = MaximizeWindow(Debugger) ;
Ret = MessageSend(GetMessageID(), "N", MyToolClass, "MAXIMIZE",
Filespec) ;
} else {
Ret = MessageSend(GetMessageID(), "F", MyToolClass, "MAXIMIZE",
Filespec) ;
}
SCRIPT.ErrorDisplay = True ;
return (TRUE) ;
}
Minimize() {
var Ret ;
Filespec = GetFilespec() ;
SCRIPT.ErrorDisplay = False;
Debugger = GetObjectID("Script debugger","CAPTION") ;
if (!IsNULL(Debugger)) {
Ret = MinimizeWindow(Debugger) ;
Ret = MessageSend(GetMessageID(), "N", MyToolClass, "MINIMIZE",
Filespec) ;
} else {
Ret = MessageSend(GetMessageID(), "F", MyToolClass, "MINIMIZE",
Filespec) ;
}
SCRIPT.ErrorDisplay = True ;
return (TRUE) ;
}
Normalize() {
var Ret ;
Filespec = GetFilespec() ;
SCRIPT.ErrorDisplay = False ;
Debugger = GetObjectID("Script debugger","CAPTION") ;
if (!IsNULL(Debugger)) {
Ret = RestoreWindow(Debugger) ;
Ret = MessageSend(GetMessageID(), "N", MyToolClass, "NORMALIZE",
Filespec) ;
} else {
Ret = MessageSend(GetMessageID(), "F", MyToolClass, "NORMALIZE",
Filespec) ;
}
SCRIPT.ErrorDisplay = True ;
return (TRUE) ;
}