|
|
'XTestLog.inc - definitions for Fast Test Utility routines ' ' Copyright (c) 1991-1992, Microsoft Corporation. All rights reserved. ' 'Purpose: ' This file defines the Log and Dialog functions of the Fast Test ' functionality '
'********************************************************** '***************** Log Subroutines ************************ '**********************************************************
' XSetLogFileName(stFilename$) ' ' Description: ' Sets global variable for use as the log name ' The global variable gsCurrentDir$ can be used to build ' the log name (it is the current directory for when the ' script is started). The default log name if this function ' is not called, is gsCurrentDir$ + "\TESTLOG.LOG" ' ' Parameters: ' stFilename$ - the filename to log to ' ' Returns: ' nothing ' ' Example: ' XSetLogFileName "c:\test\app.log" ' XSetLogFileName gsCurrentDir$ + "\app.log"
SUB XSetLogFilename(sFilename$) STATIC
gsLogFileName = sFilename$
END SUB
' ' XSetTerminate(fTerminate%) ' ' Description: ' Sets the terminate state to argument. If terminate is FALSE ' the XLogfailure will log the failure but execution will ' continue. This can lead to many failures in the log do to ' one early failure. It can also give many valid failures in ' a single run (checking all menu states for instance). ' ' ' Parameters: ' fTerminate - TRUE if should terminate on failure on, FALSE if not ' ' Returns: ' nothing ' ' Example: ' XSetTerminate FALSE ' allow multiple failures to be logged ' ' SUB XSetTerminate(fTerminate%) STATIC gfTerminate% = fTerminate% END SUB
' ' XLog(stString$) ' ' Description: ' Logs string to one or several destinations ' 1. Disk 2. Screen 3. COM1 port 4: COM2 port 5. MsgBox ' based on a OR'd Global flag gfLogOptions. The CONST's to ' work with are LOG_DISK, LOG_SCREEN, LOG_COM, and ' LOG_MSGBOX respectively. ' ' Parameters: ' stString$ - string to Log ' ' Returns: ' nothing ' ' Example: ' XSetLogOptions LOG_DISK OR LOG_SCREEN ' XLog "Something to Log" 'this will be logged to disk and viewport ' ' SUB XLog (stLog$) STATIC DIM fh%
fh% = FREEFILE
IF gfLogOptions THEN gErrorType = ET_LOG
IF (LOG_DISK AND gfLogOptions) THEN Open gsLogFileName$ For Append As #fh% Print #fh%, stLog$ Close #fh%
END IF
IF (LOG_SCREEN AND gfLogOptions) THEN 'Print the string to the Viewport Print stLog$ END IF
IF (LOG_COM1 AND gfLogOptions) THEN 'log to comport COM1
OPEN "COM1" For Append as #fh% Print #fh%, stLog$ Close #fh% END IF
IF (LOG_COM2 AND gfLogOptions) THEN 'log to comport COM2
OPEN "COM2" For Append as #fh% Print #fh%, stLog$ Close #fh% END IF
IF (LOG_MSGBOX AND gfLogOptions) THEN 'Put the string in a MsgBox IF stLog$ <> "" THEN Pause stLog$ END IF END IF gErrorType = ET_NOTHING
END IF 'gfLogOptions END SUB
' ' XLogBanner(stString$) ' ' Description: ' Logs string with a blank line before and after, ' and adds five *'s before and after the string. ' ' Parameters: ' stString$ - string to Log ' ' Returns: ' nothing ' ' Example: ' XLogBanner "Starting FOO Test" ' '
SUB XLogBanner(lpszInput$) STATIC
XLog "" XLog "***** " + lpszInput$ + " *****" XLog ""
END SUB
' ' XLogWarning(stString$) ' ' Description: ' Adds Warning banner to string ' ' Parameters: ' stString$ - string to Log ' ' Returns: ' nothing ' ' Example: ' XLogWarning "Too many menu items??" ' '
SUB XLogWarning(lpszInput$) STATIC
XLog "" XLog "!!! =====> WARNING <===== !!!" XLog "***** " + lpszInput$ + " *****" XLog ""
END SUB
' XLogFailure (stFailure$) ' ' Description: ' Logs failure with banner and ends the script ' ' Parameters: ' stFailure - Error string to logged ' ' Return: ' nothing ' ' Example: ' XLogFailure "Button does not exist" ' '
SUB XLogFailure(stFailure$) STATIC XLog "" XLog "***************** FAILURE ******************" XLog stFailure$ XLog "********************************************" XLog "" IF gfTerminate THEN End ELSE gfFailure = TRUE END IF END SUB
' ' XFailureCheck ' ' Description: ' this routine checks to see if any failures ' have occured. If so, the script is stopped. This would ' be used if XSetTerminate has been used to disable the stopping ' of the script on failures. ' ' ' Parameters: ' none ' ' Returns: ' nothing ' ' Example: ' XFailureCheck ' fail if other failures at this point ' ' SUB XFailureCheck STATIC IF gfFailure THEN XSetTerminate TRUE XLogFailure "Ending script; failures have occurred" END IF END SUB
' ' XSetLogOptions (wLogOptions%) ' ' Description: ' Sets the global log options flag to the passed options ' ' Parameters: ' wLogOptions - a set of bits OR'ed together. ' currently we have LOG_COM1 LOG_COM2 LOG_SCREEN LOG_DISK ' and LOG_MSGBOX ' Return: ' nothing ' ' Example: ' XSetLogOptions LOG_COM1 OR LOG_SCREEN 'enable logging to screen and com1 ' SUB XSetLogOptions (wLogOptions%) STATIC 'set the global log flag gfLogOptions = wLogOptions gfTmpLogOptions = gfLogOptions ' allows XLogOn after XSetLogOptions END SUB
' ' XLogOff () ' ' Description: ' Turn off logging ' ' Parameters: ' none ' ' Return: ' nothing ' ' Example: ' XLogOff ' ' SUB XLogOff () STATIC 'save the global log flag to a temporary and set options to zero gfTmpLogOptions = gfLogOptions gfLogOptions = 0 END SUB
' ' XLogOn () ' ' Description: ' Turn on logging ' ' Parameters: ' none ' ' Return: ' nothing ' ' Example: ' XLogOn ' ' SUB XLogOn () STATIC 'restore log options saved in temporary gfLogOptions = gfTmpLogOptions END SUB
'********************************************************** '***************** Dialog Subroutines ********************* '**********************************************************
' ' XDialogBoxExists(s$) ' ' Description: ' Check if a dialog box exists with given captions ' ' Parameters: ' s$ - caption of dialog to search for ' ' Returns: ' nothing ' ' Example: ' XDialogBoxExists "Open" ' ' SUB XDialogBoxExists(s$) STATIC ' won't work if app creates special class for its dialogs
IF FindWindow(gsDialogClass$,s$) = 0 THEN XLogFailure "dialog box " + s$ + " doesn't exist" END IF
END SUB
' ' XDialogBoxNotExists(s$) ' ' Description: ' Check that a dialog of given caption doesn't exist ' ' Parameters: ' s$ - caption of dialog to search for ' ' Returns: ' nothing ' ' Example: ' XDialogBoxNotExists "Close" ' ' SUB XDialogBoxNotExists(s$) STATIC
' won't work if app creates special class for its dialogs
IF FindWindow(gsDialogClass$,s$) <> 0 THEN XLogFailure "dialog box " + s$ + " exists" END IF
END SUB
' ' BDialogBoxExists(s$) ' ' Description: ' return if a dialog with given captions exists ' ' Parameters: ' s$ caption of dialog to search for ' ' Returns: ' TRUE if exist, FALSE if not ' ' Example: ' fHaveOpen% = BDialogBoxExists("Open") ' ' ' FUNCTION BDialogBoxExists%(s$) STATIC
' won't work if app creates special class for its dialogs
BDialogBoxExists = FindWindow(gsDialogClass$,s$) <> 0
END FUNCTION
' ' XWaitDialogBox(s$, WaitTime%) ' ' Description: ' wait for dialog box with string argument for caption and ' integer argument as estimate of time to keep trying before ' logging a failure ' ' Parameters: ' s$ - caption of dialog to search for ' WaitTime% - max time to keep checking for dialog ' ' Returns: ' nothing ' ' Example: ' XWaitDialogBox "Done" ' ' SUB XWaitDialogBox(s$, WaitTime%) STATIC
DIM hWnd% DIM fDone% DIM fFound% DIM ret%
fDone = FALSE fFound = FALSE
WHILE NOT fDone%
' class for dialogs created by windows is gsDialogClass$ ' won't work if app creates special class for its dialogs hWnd% = FindWindow(gsDialogClass$,s$) IF hWnd% <> 0 THEN fFound = TRUE fDone = TRUE ELSE SLEEP 1 WaitTime% = WaitTime% - 1 IF WaitTime% <= 0 THEN fDone = TRUE END IF END IF
WEND IF NOT fFound% THEN XLogFailure "FAIL """ + s$ + """ dialogbox not found" END IF END SUB
' ********************************************************** ' ***************** Dialog: Button Subroutines ************* ' **********************************************************
' ' BButtonExists(stButtonName$) ' ' Description: ' This procedure checks to see if the specified button ' exists or not. ' ' Parameters: ' stButtonName$ = button to be checked. ' ' Returns: ' TRUE if button exists, FALSE if button does not exist. ' ' Example: ' fExists% = BButtonExists("OK") ' FUNCTION BButtonExists%(stButtonName$) STATIC
BButtonExists = WButtonExists(stButtonName$) <> 0
END FUNCTION
' ' XButtonExists (stButtonName$) ' ' Description: ' Reports error if button does not exist in active window. ' ' Parameters: ' stButtonName$ - button to be found. ' ' Returns: ' nothing ' ' Example: ' XButtonExists "Cancel" ' ' ' SUB XButtonExists(stButton$) STATIC IF BButtonExists(stButton$) = 0 THEN XLogFailure stButton$ + " does not Exist" END IF END SUB
' ' XButtonNotExists (stButtonName$) ' ' Description: ' Reports error if button Exists in active window. ' ' Parameters: ' stButtonName$ - button to not be found. ' ' Returns: ' nothing ' ' Example: ' XButtonNotExists "Cancel" ' ' ' SUB XButtonNotExists(stButton$) STATIC IF BButtonExists(stButton$) THEN XLogFailure stButton$ + " Exists" END IF END SUB
' ' BButtonEnabled(stButtonName$) ' ' Description: ' This procedure checks to see if the specified button ' is enabled or not. ' ' Parameters: ' stButtonName$ - button to be checked. ' ' Returns: ' TRUE if button enabled, FALSE if button not enabled. ' ' Example: ' fEnabled% = BButtonEnabled("OK") ' FUNCTION BButtonEnabled%(stButtonName$) STATIC
BButtonEnabled = WButtonEnabled(stButtonName$) <> 0
END FUNCTION
' ' XButtonEnabled (stButtonName$) ' ' Description: ' Reports error if button is not Enabled. ' ' Parameters: ' stButtonName$ - button to be checked. ' ' Returns: ' nothing ' ' Example: ' XButtonEnabled "Cancel" ' ' SUB XButtonEnabled(stButton$) STATIC XButtonExists stButton$ IF BButtonEnabled(stButton$) = 0 THEN XLogFailure stButton$ + " is not Enabled" END IF END SUB
' ' XButtonNotEnabled (stButtonName$) ' ' Description: ' Reports error if button is Enabled. ' ' Parameters: ' stButtonName$ - button to be checked. ' ' Returns: ' nothing ' ' Example: ' XButtonNotEnabled "Cancel" ' ' SUB XButtonNotEnabled(stButton$) STATIC XButtonExists stButton$ IF BButtonEnabled(stButton$) THEN XLogFailure stButton$ + " Enabled" END IF END SUB
' ' XClickButton(stButtonName$) ' ' Description: ' This procedure clicks the specified button in the ' currently active window. ' ' Parameters: ' stButtonName$ - button to be clicked. ' ' Returns: ' nothing ' ' Example: ' XClickButton "OK" ' ' SUB XClickButton(stButtonName$) STATIC XButtonExists stButtonName$ WButtonClick stButtonName$
END SUB
' ********************************************************** ' ************* Dialog: List Box Subroutines *************** ' **********************************************************
' ' BListBoxExists(stListBox$) ' ' Description: ' This procedure checks to see if the specified ListBox ' exists or not. ' ' Parameters: ' stListBox$ - ListBox to be checked. ' ' Returns: ' TRUE if ListBox exists, FALSE if ListBox does not exist. ' ' Example: ' fExists% = BListBoxExists("cars") ' FUNCTION BListBoxExists%(stListBox$) STATIC
BListBoxExists = WListExists(stListBox$) <> 0
END FUNCTION
' ' XListBoxExists (stListBox$) ' ' Description: ' Reports error if ListBox does not exist in active window. ' ' Parameters: ' stListBox$ - ListBox to be found. ' ' Returns: ' nothing ' ' Example: ' XListBoxExists "Cars" ' ' SUB XListBoxExists(stListBox$) STATIC
IF WListExists(stListBox$) = 0 THEN XLogFailure "ListBox " + stListBox$ + " does not Exist" END IF
END SUB
' ' XListBoxNotExists (stListBox$) ' ' Description: ' Reports error if ListBox exists in active window. ' ' Parameters: ' stListBox$ - ListBox not to be found. ' ' Returns: ' nothing ' ' Example: ' XListBoxNotExists "cars" ' SUB XListBoxNotExists(stListBox$) STATIC
IF WListExists(stListBox$) THEN XLogFailure "ListBox " + stListBox$ + " exists" END IF
END SUB
' ' XFocusListBox(stListBox$) ' ' Description: ' This procedure puts focus to the specified ListBox in the ' currently active window. ' ' Parameters: ' stListBox$ - ListBox to be given focus. ' ' Returns: ' nothing ' ' Example: ' XFocusListBox "&Files:" ' SUB XFocusListBox(stListBox$) STATIC
IF WListExists(stListBox$) THEN WListItemClk stListBox$,1 'it now has focus ELSE XLogFailure "Could not put focus on " + stListBox$ + " ListBox" END IF
END SUB
' ' IGetListBoxItemCount%(stListBox$) ' ' Description: ' Returns the number of items in listbox stListBox$. ' ' Parameters: ' stListBox$ - ListBox to get item count from ' ' Returns: ' Int - List box item count ' ' Example: ' num% = IGetListBoxItemCount ("cars") ' ' FUNCTION IGetListBoxItemCount%(stListBox$) STATIC XListBoxExists stListBox$ IGetListBoxItemCount = WListCount(stListBox$)
END FUNCTION
' ' BListBoxItemExists%(stListBox$, stListBoxItem$) ' ' Description: ' Returns true if list box item exists, false otherwise. ' ' Parameters: ' stListBox$- ListBox to look in ' stListBoxItem$ - Item to look for ' ' Returns: ' Int - 0 if item does not exist, positive val otherwise ' ' Example: ' flag% = BListBoxItemExists ("&Files:","FOO.C") ' ' FUNCTION BListBoxItemExists%(stListBox$, stListBoxItem$) STATIC
BListBoxItemExists = WListItemExists (stListBox$, stListBoxItem$) <> 0
END FUNCTION
' ' XListBoxItemExists(stListBox$, stListBoxItem$) ' ' Description: ' Logs failure if list box item does not exist ' ' Parameters: ' stListBox$- ListBox to look in ' stListBoxItem$ - Item to look for ' ' Returns: ' nothing ' ' Example: ' XListBoxItemExists "&Files:","FOO.C" ' ' SUB XListBoxItemExists (stListBox$, stListBoxItem$) STATIC
XListBoxExists stListBox$ IF WListItemExists (stListBox$, stListBoxItem$) = 0 THEN XLogFailure "ListBoxItem " + stListBoxItem$ + " does not exist" END IF
END SUB
' ' XListBoxItemNotExists(stListBox$, stListBoxItem$) ' ' Description: ' Logs failure if list box item exists ' ' Parameters: ' stListBox$ - ListBox to look in ' stListBoxItem$ - Item to look for ' ' Returns: ' nothing ' ' Example: ' XListBoxItemNotExists "&Files:","FOO.C" ' ' SUB XListBoxItemNotExists (stListBox$, stListBoxItem$) STATIC
XListBoxExists stListBox$ IF WListItemExists (stListBox$, stListBoxItem$) <> 0 THEN XLogFailure "ListBoxItem " + stListBoxItem$ + " exists" END IF
END SUB
' ' XClickListBoxItem(stListBox$, stListBoxItem$) ' ' Description: ' Clicks on list box item ' ' Parameters: ' stListBox$ - ListBox to look in ' stListBoxItem$ - Item to click on ' ' Returns: ' nothing ' ' Example: ' XClickListBoxItem "&Files:","FOO.C" ' ' SUB XClickListBoxItem (stListBox$, stListBoxItem$) STATIC
XListBoxExists stListBox$ XListBoxItemExists stListBox$, stListBoxItem$ WListItemClkT stListBox$, stListBoxItem$
END SUB
' ' XDblClickListBoxItem% (stListBox$, stListBoxItem$) ' ' Description: ' Clicks on list box item ' ' Parameters: ' stListBox$ - ListBox to look in ' stListBoxItem$ - Item to click on ' ' Returns: ' nothing ' ' Example: ' XDblClickListBoxItem "&Files:","FOO.C" ' ' SUB XDblClickListBoxItem (stListBox$, stListBoxItem$) STATIC
XListBoxExists stListBox$ XListBoxItemExists stListBox$, stListBoxItem$ WListItemDblClkT stListBox$, stListBoxItem$
END SUB
' ' SGetListBoxItemText (stListBox$) ' ' Description: ' Returns currently selected list box item ' ' Parameters: ' stListBox$ is the listbox to get item from ' ' Returns: ' ListBox Item string ' ' Example: ' a$ = SGetListBoxItemText ("&User List:") ' ' FUNCTION SGetListBoxItemText$(stListBox$) STATIC
XListBoxExists stListBox$ SGetListBoxItemText = ListText(stListBox$)
END FUNCTION
' ********************************************************** ' ************* Dialog: Combo Box Subroutines ************** ' **********************************************************
' ' BComboBoxExists%(stComboBox$) ' ' Description: ' This procedure checks to see if the specified ComboBox ' exists or not. ' ' Parameters: ' stComboBox$ = ComboBox to be checked. ' ' Returns: ' TRUE if ComboBox exists. ' FALSE if ComboBox does not exist. ' ' Example: ' fExists% = BComboBoxExists("&File") ' FUNCTION BComboBoxExists%(stComboBox$) STATIC
BComboBoxExists = WComboExists(stComboBox$) <> 0
END FUNCTION
' ' XComboBoxExists (stComboBox$) ' ' Description: ' Reports error if ComboBox does not exist in active window. ' ' Parameters: ' stComboBox$ - ComboBox to be found. ' ' Returns: ' nothing ' ' Example: ' XComboBoxExists "&File" ' ' SUB XComboBoxExists(stComboBox$) STATIC
IF WComboExists(stComboBox$) = 0 THEN XLogFailure "ComboBox " + stComboBox$ + " does not Exist" END IF
END SUB
' ' XComboBoxNotExists (stComboBox$) ' ' Description: ' Reports error if ComboBox exists in active window. ' ' Parameters: ' stComboBox$ - ComboBox not to be found. ' ' Returns: ' nothing ' ' Example: ' XComboBoxNotExists "&File" ' SUB XComboBoxNotExists(stComboBox$) STATIC
IF WComboExists(stComboBox$) THEN XLogFailure "ComboBox " + stComboBox$ + " exists" END IF
END SUB
' ' XFocusComboBox(stComboBox$) ' ' Description: ' This procedure puts focus to the specified ComboBox in the ' currently active window. ' ' Parameters: ' stComboBox$ = ComboBox to be given focus. ' ' Returns: ' nothing ' ' Example: ' XFocusComboBox("&Files:") ' SUB XFocusComboBox(stComboBox$) STATIC
IF WComboExists(stComboBox$) THEN WComboItemClk stComboBox$,1 'it now has focus ELSE XLogFailure "Could not put focus on " + stComboBox$ + " ComboBox" END IF
END SUB
' ' IWGetComboBoxItemCount%(stComboBox$) ' ' Description: ' Returns the number of items in ComboBox stComboBox$. ' ' Parameters: ' stComboBox$ - ComboBox to get item count from ' ' Returns: ' Int - Combo box item count ' ' Example: ' num% = WComboBoxItemCount () ' ' FUNCTION IGetComboBoxItemCount%(stComboBox$) STATIC XComboBoxExists stComboBox$ IGetComboBoxItemCount = WComboCount(stComboBox$)
END FUNCTION
' ' BComboBoxItemExists%(stComboBox$, stComboBoxItem$) ' ' Description: ' Returns true if Combo box item exists, false otherwise. ' ' Parameters: ' stComboBox$ - ComboBox to look in ' stComboBoxItem$ - Item to look for ' ' Returns: ' Int - 0 if item does not exist, positive val otherwise ' ' Example: ' flag% = BComboBoxItemExists("&Files","FOO.C") ' FUNCTION BComboBoxItemExists%(stComboBox$, stComboBoxItem$) STATIC
BComboBoxItemExists = WComboItemExists (stComboBox$, stComboBoxItem$) <> 0
END FUNCTION
' ' XComboBoxItemExists(stComboBox$, stComboBoxItem$) ' ' Description: ' Logs failure if combo box item does not exist ' ' Parameters: ' stComboBox$ - ComboBox to look in ' stComboBoxItem$ - Item to look for ' ' Returns: ' nothing ' ' Example: ' XComboBoxItemExists "&Files","FOO.C" ' ' SUB XComboBoxItemExists (stComboBox$, stComboBoxItem$) STATIC XComboBoxExists stComboBox$ IF WComboItemExists (stComboBox$, stComboBoxItem$) = 0 THEN XLogFailure "ComboBoxItem " + stComboBoxItem$ + " does not exist" END IF
END SUB
' ' XComboBoxItemNotExists(stComboBox$, stComboBoxItem$) ' ' Description: ' Logs failure if combo box item exists ' ' Parameters: ' stComboBox$ - ComboBox to look in ' stComboBoxItem$ - Item to look for ' ' Returns: ' nothing ' ' Example: ' XComboBoxItemNotExists "&Files","FOO.C" ' ' SUB XComboBoxItemNotExists (stComboBox$, stComboBoxItem$) STATIC
XComboBoxExists stComboBox$ IF WComboItemExists (stComboBox$, stComboBoxItem$) THEN XLogFailure "ComboBoxItem " + stComboBoxItem$ + " exists" END IF
END SUB
' ' XClickComboBoxItem(stComboBox$, stComboBoxItem$) ' ' Description: ' Clicks on Combo box item ' ' Parameters: ' stComboBox$ - ComboBox to look in ' stComboBoxItem$ - Item to click on ' ' Returns: ' nothing ' ' Example: ' XClickComboBoxItem "&Files","FOO.C" ' ' SUB XClickComboBoxItem (stComboBox$, stComboBoxItem$) STATIC
XComboBoxExists stComboBox$ XComboBoxItemExists stComboBox$,stComboBoxItem$ WComboItemClkT stComboBox$, stComboBoxItem$
END SUB
' ' XDblClickComboBoxItem% (stComboBox$, stComboBoxItem$) ' ' Description: ' Clicks on combo box item ' ' Parameters: ' stComboBox$ - ComboBox to look in ' stComboBoxItem$ - Item to click on ' ' Returns: ' nothing ' ' Example: ' XDblClickComboBoxItem "&Files","FOO.C" ' ' SUB XDblClickComboBoxItem (stComboBox$, stComboBoxItem$) STATIC
XComboBoxExists stComboBox$ XComboBoxItemExists stComboBox$,stComboBoxItem$ WComboItemDblClkT stComboBox$, stComboBoxItem$
END SUB
' ' StGetComboBoxItemText (stComboBox$) ' ' Description: ' Returns currently selected Combo box item ' ' Parameters: ' stComboBox$ is the ComboBox to get item from ' ' Returns: ' ComboBox Item string ' ' Example: ' a$ = SGetComboBoxItemText ("&User List:") ' FUNCTION SGetComboBoxItemText$(stComboBox$) STATIC
XComboBoxExists stComboBox$ XComboBoxItemExists stComboBox$,stComboBoxItem$ SGetComboBoxItemText = ComboText(stComboBox$)
END FUNCTION
' ********************************************************** ' ************* Dialog: Check Box Subroutines ************** ' **********************************************************
' ' BCheckBoxExists(stCheckBox$) ' ' Description: ' This procedure checks to see if the specified CheckBox ' exists or not. ' ' Parameters: ' stCheckBox$ = CheckBox to be checked. ' ' Returns: ' TRUE if CheckBox exists. ' FALSE if CheckBox does not exist. ' ' Example: ' fExists% = BCheckBoxExists("&Delete") ' FUNCTION BCheckBoxExists%(stCheckBox$) STATIC
BCheckBoxExists = WCheckExists(stCheckBox$) <> 0
END FUNCTION
' ' XCheckBoxExists (stCheckBox$) ' ' Description: ' Reports error if CheckBox does not exist in active window. ' ' Parameters: ' stCheckBox$ - CheckBox to be found. ' ' Returns: ' nothing ' ' Example: ' XCheckBoxExists "&Delete" ' SUB XCheckBoxExists(stCheckBox$) STATIC IF BCheckBoxExists(stCheckBox$) = 0 THEN XLogFailure "CheckBox " + stCheckBox$ + " does not Exist" END IF END SUB
' ' XCheckBoxNotExists (stCheckBox$) ' ' Description: ' Reports error if CheckBox Exists in active window. ' ' Parameters: ' stCheckBox$ - CheckBox to not be found. ' ' Returns: ' nothing ' ' Example: ' XCheckBoxNotExists "&Delete" ' ' SUB XCheckBoxNotExists(stCheckBox$) STATIC IF BCheckBoxExists(stCheckBox$) THEN XLogFailure "CheckBox " + stCheckBox$ + " Exists" END IF END SUB
' ' BCheckBoxChecked(stCheckBox$) ' ' Description: ' This procedure checks the state of checkbox ' ' Parameters: ' stCheckBox$ = CheckBox to check state of. ' ' Returns: ' -1(true) if the check box is checked. ' 0(false) if the check box is not checked. ' ' Example: ' state% = BCheckBoxChecked("Special") ' FUNCTION BCheckBoxChecked%(stCheckBox$) STATIC BCheckBoxChecked = WCheckState(stCheckBox$) <> 0 END FUNCTION
' ' XCheckBoxChecked(stCheckBox$) ' ' Description: ' This procedure checks the state of checkbox ' ' Parameters: ' stCheckBox$ = CheckBox to check state of. ' ' Returns: ' -1(true) if the check box is checked. ' 0(false) if the check box is not checked. ' ' Example: ' XCheckBoxChecked "Special" ' SUB XCheckBoxChecked(stCheckBox$) STATIC XCheckBoxExists stCheckBox$ IF BCheckBoxChecked(stCheckBox$) = 0 THEN XLogFailure "CheckBox " + stCheckBox$ + " is not checked" END IF
END SUB
' ' XCheckBoxNotChecked(stCheckBox$) ' ' Description: ' This procedure checks the state of checkbox ' ' Parameters: ' stCheckBox$ = CheckBox to check state of. ' ' Returns: ' -1(true) if the check box is checked. ' 0(false) if the check box is not checked. ' ' Example: ' XCheckBoxNotChecked "Special" ' SUB XCheckBoxNotChecked(stCheckBox$) STATIC XCheckBoxExists stCheckBox$ IF BCheckBoxChecked(stCheckBox$) THEN XLogFailure "CheckBox " + stCheckBox$ + " is checked" END IF
END SUB
' ' BCheckBoxEnabled(stCheckBox$) ' ' Description: ' This procedure checks to see if the specified CheckBox ' is enabled or not. ' ' Parameters: ' stCheckBox$ = CheckBox to be checked. ' ' Returns: ' TRUE if CheckBox enabled. ' FALSE if CheckBox not enabled. ' ' Example: ' fEnabled% = BCheckBoxEnabled("&Delete") ' FUNCTION BCheckBoxEnabled%(stCheckBox$) STATIC
BCheckBoxEnabled = WCheckEnabled(stCheckBox$) <> 0
END FUNCTION
' ' XCheckBoxEnabled (stCheckBox$) ' ' Description: ' Reports error if CheckBox is not Enabled. ' ' Parameters: ' stCheckBox$ - CheckBox to be checked. ' ' Returns: ' nothing ' ' Example: ' XCheckBoxEnabled "&Delete" ' ' SUB XCheckBoxEnabled(stCheckBox$) STATIC XCheckBoxExists(stCheckBox$) IF BCheckBoxEnabled(stCheckBox$) = 0 THEN XLogFailure "CheckBox " + stCheckBox$ + " is not Enabled" END IF END SUB
' ' XCheckBoxNotEnabled (stCheckBox$) ' ' Description: ' Reports error if CheckBox is Enabled. ' ' Parameters: ' stCheckBox$ - CheckBox to be checked. ' ' Returns: ' nothing ' ' Example: ' XCheckBoxNotEnabled "&Delete" ' SUB XCheckBoxNotEnabled(stCheckBox$) STATIC XCheckBoxExists(stCheckBox$) IF BCheckBoxEnabled(stCheckBox$) THEN XLogFailure "CheckBox " + stCheckBox$ + " is Enabled" END IF
END SUB
' ' XClickCheckBox(stCheckBox$) ' ' Description: ' This procedure clicks the specified CheckBox in the ' currently active window. ' ' Parameters: ' stCheckBox$ = CheckBox to be clicked. ' ' Returns: ' nothing ' ' Example: ' XClickCheckBox "&Delete" ' SUB XClickCheckBox(stCheckBox$) STATIC XCheckBoxExists stCheckBox$ WCheckClick stCheckBox$
END SUB
' ********************************************************** ' ************* Dialog: Edit Control Subroutines *********** ' **********************************************************
' ' XEditTextExists(stEditText$) ' ' Description: ' This procedure checks to see if the specified EditText ' exists or not. ' ' Parameters: ' stEditText$ = EditText to be checked. ' ' Returns: ' TRUE if EditText exists. ' FALSE if EditText does not exist. ' ' Example: ' XEditTextExists "File" ' SUB XEditTextExists(stEditText$) STATIC
IF BEditTextExists(stEditText$) = 0 THEN XLogFailure "Edit Text control " + stEditText$ + " does not exist" END IF
END SUB
' ' XEditTextNotExists(stEditTextNot$) ' ' Description: ' This procedure checks to see that the specified EditText ' doesn't exist ' ' Parameters: ' stEditTextNot$ = EditText to be checked. ' ' Example: ' XEditTextNotExists "File" ' SUB XEditTextNotExists(stEditTextNot$) STATIC
IF BEditTextExists(stEditTextNot$) THEN XLogFailure "Edit Text control " + stEditTextNot$ + " exists" END IF
END SUB
' ' BEditTextExists(stEditText$) ' ' Description: ' This procedure checks to see if the specified EditText ' exists or not. ' ' Parameters: ' stEditText$ = EditText to be checked. ' ' Returns: ' TRUE if EditText exists. ' FALSE if EditText does not exist. ' ' Example: ' fExists% = BEditTextExists("File") ' FUNCTION BEditTextExists%(stEditText$) STATIC
BEditTextExists = WEditExists(stEditText$) <> 0
END FUNCTION
' ' StGetEditText (stEditCaption$) ' ' Description: ' Returns string in Edit box with caption stEditCaption$ ' Logs error if stEditCaption$ is not found, or if Edit control ' is not found following stEditCaption$ in the tabbing order. ' ' Parameters: ' stEditCaption$ - Caption that is associated with edit control ' ' Returns: ' String that is in the Edit control ' ' Example: ' a$ = SGetEditText("&FileName:") ' ' FUNCTION SGetEditText$(stEditCaption$) STATIC XEditTextExists stEditCaption$ SGetEditText = EditText(stEditCaption$)
END FUNCTION
' ' XSetEditText (stEditCaption$, stEditText$) ' ' Description: ' Puts string stEditText$ in Edit box with caption stEditCaption$ ' Logs error if stEditCaption$ is not found, or if Edit control ' is not found following stEditCaption$ in the tabbing order. ' ' Parameters: ' stEditCaption$ - Caption that is associated with edit control ' stEditText$ - Text to put in the Edit control ' ' Returns: ' nothing ' ' Example: ' XSetEditText "&FileName:", "calc.exe" ' '
SUB XSetEditText (stEditCaption$, stEditText$) STATIC
XEditTextExists stEditCaption$ WEditSetText stEditCaption$, stEditText$
END SUB
' ********************************************************** ' ************* Dialog: Option Button Subroutines *********** ' **********************************************************
' ' BOptionButtonExists(stOptionButton$) ' ' Description: ' This procedure checks to see if the specified OptionButton ' exists or not. ' ' Parameters: ' stOptionButton$ = OptionButton to be checked. ' ' Returns: ' TRUE if OptionButton exists. ' FALSE if OptionButton does not exist. ' ' Example: ' fExists% = BOptionButtonExists("Blue") ' FUNCTION BOptionButtonExists%(stOptionButton$) STATIC
BOptionButtonExists = WOptionExists(stOptionButton$) <> 0
END FUNCTION
' ' XOptionButtonExists (stOptionButton$) ' ' Description: ' Reports error if OptionButton does not exist in active window. ' ' Parameters: ' stOptionButton$ - OptionButton to be found. ' ' Returns: ' nothing ' ' Example: ' XOptionButtonExists "Blue" ' SUB XOptionButtonExists(stOptionButton$) STATIC IF BOptionButtonExists(stOptionButton$) = 0 THEN XLogFailure "OptionButton " + stOptionButton$ + " does not Exist" END IF END SUB
' ' XOptionButtonNotExists (stOptionButton$) ' ' Description: ' Reports error if OptionButton Exists in active window. ' ' Parameters: ' stOptionButton$ - OptionButton to not be found. ' ' Returns: ' nothing ' ' Example: ' XOptionButtonNotExists "Blue" ' SUB XOptionButtonNotExists(stOptionButton$) STATIC IF BOptionButtonExists(stOptionButton$) THEN XLogFailure "OptionButton " + stOptionButton$ + " Exists" END IF END SUB
' ' BOptionButtonEnabled(stOptionButton$) ' ' Description: ' This procedure checks to see if the specified OptionButton ' is enabled or not. ' ' Parameters: ' stOptionButton$ = OptionButton to be checked. ' ' Returns: ' TRUE if OptionButton enabled. ' FALSE if OptionButton not enabled. ' ' Example: ' fEnabled% = BOptionButtonEnabled("Blue") ' FUNCTION BOptionButtonEnabled%(stOptionButton$) STATIC BOptionButtonEnabled = WOptionEnabled(stOptionButton$) <> 0 END FUNCTION
' ' XOptionButtonEnabled (stOptionButton$) ' ' Description: ' Reports error if OptionButton is not Enabled. ' ' Parameters: ' stOptionButton$ - OptionButton to be checked. ' ' Returns: ' nothing ' ' Example: ' XOptionButtonEnabled "Blue" ' SUB XOptionButtonEnabled(stOptionButton$) STATIC XOptionButtonExists stOptionButton$ IF BOptionButtonEnabled(stOptionButton$) = 0 THEN XLogFailure "OptionButton " + stOptionButton$ + " is not Enabled" END IF END SUB
' ' XOptionButtonNotEnabled (stOptionButton$) ' ' Description: ' Reports error if OptionButton is Enabled. ' ' Parameters: ' stOptionButton$ - OptionButton to be checked. ' ' Returns: ' nothing ' ' Example: ' XOptionButtonNotEnabled "Blue" ' ' SUB XOptionButtonNotEnabled(stOptionButton$) STATIC XOptionButtonExists stOptionButton$ IF BOptionButtonEnabled(stOptionButton$) THEN XLogFailure "OptionButton " + stOptionButton$ + " Enabled" END IF END SUB
' ' BOptionButtonChecked(stOptionButton$) ' ' Description: ' This procedure checks to see if the specified OptionButton ' is Checked or not. ' ' Parameters: ' stOptionButton$ = OptionButton to be checked. ' ' Returns: ' TRUE if OptionButton Checked. ' FALSE if OptionButton not Checked. ' ' Example: ' fChecked% = BOptionButtonChecked("Blue") ' FUNCTION BOptionButtonChecked%(stOptionButton$) STATIC
BOptionButtonChecked = WOptionState(stOptionButton$) <> 0
END FUNCTION
' ' XOptionButtonChecked (stOptionButton$) ' ' Description: ' Reports error if OptionButton is not Checked. ' ' Parameters: ' stOptionButton$ - OptionButton to be checked. ' ' Returns: ' nothing ' ' Example: ' XOptionButtonChecked "Blue" ' SUB XOptionButtonChecked(stOptionButton$) STATIC XOptionButtonExists stOptionButton$ IF BOptionButtonChecked(stOptionButton$) = 0 THEN XLogFailure "OptionButton " + stOptionButton$ + " is not Checked" END IF END SUB
' ' XOptionButtonNotChecked (stOptionButton$) ' ' Description: ' Reports error if OptionButton is Checked. ' ' Parameters: ' stOptionButton$ - OptionButton to be checked. ' ' Returns: ' nothing ' ' Example: ' XOptionButtonNotChecked "Blue" ' ' SUB XOptionButtonNotChecked(stOptionButton$) STATIC XOptionButtonExists stOptionButton$ IF BOptionButtonChecked(stOptionButton$) THEN XLogFailure "OptionButton " + stOptionButton$ + " Checked" END IF END SUB
' ' XClickOptionButton(stOptionButton$) ' ' Description: ' This procedure clicks the specified OptionButton in the ' currently active window. ' ' Parameters: ' stOptionButton$ = OptionButton to be clicked. ' ' Returns: ' nothing ' ' Example: ' XClickOptionButton "Blue" ' SUB XClickOptionButton(stOptionButton$) STATIC XOptionButtonExists stOptionButton$ WOptionClick stOptionButton$
END SUB
|