|
|
1.1 root 1: '$define testevnt
2: '$define W_WINDOW
3: '$include: 'mstest.inc'
4:
5:
6: Const SW_SHOWNORMAL= 1
7: Const SW_SHOWMAXIMIZED = 3
8: Const LOG_FILE_NUM = 4
9: Const LOG_FILE = "logfile.LOG"
10: Const BACKUP_FILE = "logfile.BAK"
11:
12: DIM x%,hWnd%
13:
14: ' need to change kernel to base32.dll, user to user32.dll, etc if you use
15: ' this under nt
16:
17: '----------------------------------------------------------------------------
18: ' Sub and Function declarations
19: '----------------------------------------------------------------------------
20: Declare Sub BackUpLogFile()
21: Declare Sub PrintLogHeader()
22: Declare Sub PrintLogFooter()
23: Declare Sub OpenLogFile()
24: Declare Sub CloseLogFile()
25: Declare Sub LogOut(LogText$,method%)
26:
27: Declare Function PopUp(x%,lpText$) As Integer
28: '$IFDEF WIN16
29: Declare Function MessageBox Lib "User.exe" ( hWnd%, lpText$, lpCaption$, wType%) As Integer
30: Declare Function GetActiveWindow Lib "User" () As Integer
31: Declare Function WinExec Lib "krnl386.exe" (lpCmdLine$, nCmdShow%) As Integer
32: '$ELSE
33: Declare Function MessageBox Lib "USER32" ALIAS "MessageBoxExA" ( hWnd%, lpText$, lpCaption$, wType%) As Integer
34: Declare Function GetActiveWindow Lib "User32" ALIAS "GetActiveWindow" () As Integer
35: Declare Function WinExec Lib "Kernel32" ALIAS "WinExec" (lpCmdLine$, nCmdShow%) As Integer
36: '$ENDIF
37:
38: '----------------------------------------------------------------------------
39: ' Subs
40: '----------------------------------------------------------------------------
41:
42: Function PopUp(x%,lpText$) Static As Integer
43: hWnd=GetActiveWindow()
44: x%=MessageBox(hWnd,lpText,"MS-Test Popup",0)
45: End Function
46:
47: '******************************************************************************
48: 'SUB BackUpLogFile saves the last log file (if it exists). If
49: 'a backup log file already exists, it is deleted and replaced
50: 'with the new backup.
51: '******************************************************************************
52: Sub BackUpLogFile Static
53:
54: IF Exists(LOG_FILE) THEN
55: IF Exists(BACKUP_FILE) THEN
56: Kill BACKUP_FILE
57: End If
58: Name LOG_FILE AS BACKUP_FILE
59: END IF
60:
61: End Sub
62:
63:
64: '******************************************************************************
65: 'SUB PrintLogHeader prints a starting banner to the log file
66: '******************************************************************************
67: Sub PrintLogHeader () Static
68: Open LOG_FILE For Append As #1
69:
70: Print #1, "*******************************************************************************"
71: Print #1, "* MSTest log file *"
72: Print #1, "* "; DateTime$; " *"
73: Print #1, "* *"
74: Print #1, "*******************************************************************************"
75: Print #1,
76: Close #1
77: End Sub
78:
79:
80: '******************************************************************************
81: 'SUB PrintLogFooter prints an ending banner to the log file
82: '******************************************************************************
83: Sub PrintLogFooter () Static
84: Open LOG_FILE For Append As #1
85:
86: Print #1,
87: Print #1, "*******************************************************************************"
88: Print #1, "* Test complete *"
89: Print #1, "* "; DateTime$; " *"
90: Print #1, "*******************************************************************************"
91: Print #1,
92: Close #1
93: End Sub
94:
95: '******************************************************************************
96: 'SUB OpenLogFile
97: '******************************************************************************
98: Sub OpenLogFile() Static
99: Open LOG_FILE For Append As #LOG_FILE_NUM
100: End Sub
101:
102:
103: '******************************************************************************
104: 'SUB CloseLogFile
105: '******************************************************************************
106: Sub CloseLogFile() Static
107: Close #LOG_FILE_NUM
108: End Sub
109:
110: '******************************************************************************
111: 'SUB LogOut
112: ''******************************************************************************
113: Sub LogOut(logFile$, x%) Static
114: Print #LOG_FILE_NUM, logFile$
115: End Sub
116:
117:
118:
119:
120:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.