Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1828 lines
35 KiB

  1. 'XTestLog.inc - definitions for Fast Test Utility routines
  2. '
  3. ' Copyright (c) 1991-1992, Microsoft Corporation. All rights reserved.
  4. '
  5. 'Purpose:
  6. ' This file defines the Log and Dialog functions of the Fast Test
  7. ' functionality
  8. '
  9. '**********************************************************
  10. '***************** Log Subroutines ************************
  11. '**********************************************************
  12. ' XSetLogFileName(stFilename$)
  13. '
  14. ' Description:
  15. ' Sets global variable for use as the log name
  16. ' The global variable gsCurrentDir$ can be used to build
  17. ' the log name (it is the current directory for when the
  18. ' script is started). The default log name if this function
  19. ' is not called, is gsCurrentDir$ + "\TESTLOG.LOG"
  20. '
  21. ' Parameters:
  22. ' stFilename$ - the filename to log to
  23. '
  24. ' Returns:
  25. ' nothing
  26. '
  27. ' Example:
  28. ' XSetLogFileName "c:\test\app.log"
  29. ' XSetLogFileName gsCurrentDir$ + "\app.log"
  30. SUB XSetLogFilename(sFilename$) STATIC
  31. gsLogFileName = sFilename$
  32. END SUB
  33. '
  34. ' XSetTerminate(fTerminate%)
  35. '
  36. ' Description:
  37. ' Sets the terminate state to argument. If terminate is FALSE
  38. ' the XLogfailure will log the failure but execution will
  39. ' continue. This can lead to many failures in the log do to
  40. ' one early failure. It can also give many valid failures in
  41. ' a single run (checking all menu states for instance).
  42. '
  43. '
  44. ' Parameters:
  45. ' fTerminate - TRUE if should terminate on failure on, FALSE if not
  46. '
  47. ' Returns:
  48. ' nothing
  49. '
  50. ' Example:
  51. ' XSetTerminate FALSE ' allow multiple failures to be logged
  52. '
  53. '
  54. SUB XSetTerminate(fTerminate%) STATIC
  55. gfTerminate% = fTerminate%
  56. END SUB
  57. '
  58. ' XLog(stString$)
  59. '
  60. ' Description:
  61. ' Logs string to one or several destinations
  62. ' 1. Disk 2. Screen 3. COM1 port 4: COM2 port 5. MsgBox
  63. ' based on a OR'd Global flag gfLogOptions. The CONST's to
  64. ' work with are LOG_DISK, LOG_SCREEN, LOG_COM, and
  65. ' LOG_MSGBOX respectively.
  66. '
  67. ' Parameters:
  68. ' stString$ - string to Log
  69. '
  70. ' Returns:
  71. ' nothing
  72. '
  73. ' Example:
  74. ' XSetLogOptions LOG_DISK OR LOG_SCREEN
  75. ' XLog "Something to Log" 'this will be logged to disk and viewport
  76. '
  77. '
  78. SUB XLog (stLog$) STATIC
  79. DIM fh%
  80. fh% = FREEFILE
  81. IF gfLogOptions THEN
  82. gErrorType = ET_LOG
  83. IF (LOG_DISK AND gfLogOptions) THEN
  84. Open gsLogFileName$ For Append As #fh%
  85. Print #fh%, stLog$
  86. Close #fh%
  87. END IF
  88. IF (LOG_SCREEN AND gfLogOptions) THEN
  89. 'Print the string to the Viewport
  90. Print stLog$
  91. END IF
  92. IF (LOG_COM1 AND gfLogOptions) THEN
  93. 'log to comport COM1
  94. OPEN "COM1" For Append as #fh%
  95. Print #fh%, stLog$
  96. Close #fh%
  97. END IF
  98. IF (LOG_COM2 AND gfLogOptions) THEN
  99. 'log to comport COM2
  100. OPEN "COM2" For Append as #fh%
  101. Print #fh%, stLog$
  102. Close #fh%
  103. END IF
  104. IF (LOG_MSGBOX AND gfLogOptions) THEN
  105. 'Put the string in a MsgBox
  106. IF stLog$ <> "" THEN
  107. Pause stLog$
  108. END IF
  109. END IF
  110. gErrorType = ET_NOTHING
  111. END IF 'gfLogOptions
  112. END SUB
  113. '
  114. ' XLogBanner(stString$)
  115. '
  116. ' Description:
  117. ' Logs string with a blank line before and after,
  118. ' and adds five *'s before and after the string.
  119. '
  120. ' Parameters:
  121. ' stString$ - string to Log
  122. '
  123. ' Returns:
  124. ' nothing
  125. '
  126. ' Example:
  127. ' XLogBanner "Starting FOO Test"
  128. '
  129. '
  130. SUB XLogBanner(lpszInput$) STATIC
  131. XLog ""
  132. XLog "***** " + lpszInput$ + " *****"
  133. XLog ""
  134. END SUB
  135. '
  136. ' XLogWarning(stString$)
  137. '
  138. ' Description:
  139. ' Adds Warning banner to string
  140. '
  141. ' Parameters:
  142. ' stString$ - string to Log
  143. '
  144. ' Returns:
  145. ' nothing
  146. '
  147. ' Example:
  148. ' XLogWarning "Too many menu items??"
  149. '
  150. '
  151. SUB XLogWarning(lpszInput$) STATIC
  152. XLog ""
  153. XLog "!!! =====> WARNING <===== !!!"
  154. XLog "***** " + lpszInput$ + " *****"
  155. XLog ""
  156. END SUB
  157. ' XLogFailure (stFailure$)
  158. '
  159. ' Description:
  160. ' Logs failure with banner and ends the script
  161. '
  162. ' Parameters:
  163. ' stFailure - Error string to logged
  164. '
  165. ' Return:
  166. ' nothing
  167. '
  168. ' Example:
  169. ' XLogFailure "Button does not exist"
  170. '
  171. '
  172. SUB XLogFailure(stFailure$) STATIC
  173. XLog ""
  174. XLog "***************** FAILURE ******************"
  175. XLog stFailure$
  176. XLog "********************************************"
  177. XLog ""
  178. IF gfTerminate THEN
  179. End
  180. ELSE
  181. gfFailure = TRUE
  182. END IF
  183. END SUB
  184. '
  185. ' XFailureCheck
  186. '
  187. ' Description:
  188. ' this routine checks to see if any failures
  189. ' have occured. If so, the script is stopped. This would
  190. ' be used if XSetTerminate has been used to disable the stopping
  191. ' of the script on failures.
  192. '
  193. '
  194. ' Parameters:
  195. ' none
  196. '
  197. ' Returns:
  198. ' nothing
  199. '
  200. ' Example:
  201. ' XFailureCheck ' fail if other failures at this point
  202. '
  203. '
  204. SUB XFailureCheck STATIC
  205. IF gfFailure THEN
  206. XSetTerminate TRUE
  207. XLogFailure "Ending script; failures have occurred"
  208. END IF
  209. END SUB
  210. '
  211. ' XSetLogOptions (wLogOptions%)
  212. '
  213. ' Description:
  214. ' Sets the global log options flag to the passed options
  215. '
  216. ' Parameters:
  217. ' wLogOptions - a set of bits OR'ed together.
  218. ' currently we have LOG_COM1 LOG_COM2 LOG_SCREEN LOG_DISK
  219. ' and LOG_MSGBOX
  220. ' Return:
  221. ' nothing
  222. '
  223. ' Example:
  224. ' XSetLogOptions LOG_COM1 OR LOG_SCREEN 'enable logging to screen and com1
  225. '
  226. SUB XSetLogOptions (wLogOptions%) STATIC
  227. 'set the global log flag
  228. gfLogOptions = wLogOptions
  229. gfTmpLogOptions = gfLogOptions ' allows XLogOn after XSetLogOptions
  230. END SUB
  231. '
  232. ' XLogOff ()
  233. '
  234. ' Description:
  235. ' Turn off logging
  236. '
  237. ' Parameters:
  238. ' none
  239. '
  240. ' Return:
  241. ' nothing
  242. '
  243. ' Example:
  244. ' XLogOff
  245. '
  246. '
  247. SUB XLogOff () STATIC
  248. 'save the global log flag to a temporary and set options to zero
  249. gfTmpLogOptions = gfLogOptions
  250. gfLogOptions = 0
  251. END SUB
  252. '
  253. ' XLogOn ()
  254. '
  255. ' Description:
  256. ' Turn on logging
  257. '
  258. ' Parameters:
  259. ' none
  260. '
  261. ' Return:
  262. ' nothing
  263. '
  264. ' Example:
  265. ' XLogOn
  266. '
  267. '
  268. SUB XLogOn () STATIC
  269. 'restore log options saved in temporary
  270. gfLogOptions = gfTmpLogOptions
  271. END SUB
  272. '**********************************************************
  273. '***************** Dialog Subroutines *********************
  274. '**********************************************************
  275. '
  276. ' XDialogBoxExists(s$)
  277. '
  278. ' Description:
  279. ' Check if a dialog box exists with given captions
  280. '
  281. ' Parameters:
  282. ' s$ - caption of dialog to search for
  283. '
  284. ' Returns:
  285. ' nothing
  286. '
  287. ' Example:
  288. ' XDialogBoxExists "Open"
  289. '
  290. '
  291. SUB XDialogBoxExists(s$) STATIC
  292. ' won't work if app creates special class for its dialogs
  293. IF FindWindow(gsDialogClass$,s$) = 0 THEN
  294. XLogFailure "dialog box " + s$ + " doesn't exist"
  295. END IF
  296. END SUB
  297. '
  298. ' XDialogBoxNotExists(s$)
  299. '
  300. ' Description:
  301. ' Check that a dialog of given caption doesn't exist
  302. '
  303. ' Parameters:
  304. ' s$ - caption of dialog to search for
  305. '
  306. ' Returns:
  307. ' nothing
  308. '
  309. ' Example:
  310. ' XDialogBoxNotExists "Close"
  311. '
  312. '
  313. SUB XDialogBoxNotExists(s$) STATIC
  314. ' won't work if app creates special class for its dialogs
  315. IF FindWindow(gsDialogClass$,s$) <> 0 THEN
  316. XLogFailure "dialog box " + s$ + " exists"
  317. END IF
  318. END SUB
  319. '
  320. ' BDialogBoxExists(s$)
  321. '
  322. ' Description:
  323. ' return if a dialog with given captions exists
  324. '
  325. ' Parameters:
  326. ' s$ caption of dialog to search for
  327. '
  328. ' Returns:
  329. ' TRUE if exist, FALSE if not
  330. '
  331. ' Example:
  332. ' fHaveOpen% = BDialogBoxExists("Open")
  333. '
  334. '
  335. '
  336. FUNCTION BDialogBoxExists%(s$) STATIC
  337. ' won't work if app creates special class for its dialogs
  338. BDialogBoxExists = FindWindow(gsDialogClass$,s$) <> 0
  339. END FUNCTION
  340. '
  341. ' XWaitDialogBox(s$, WaitTime%)
  342. '
  343. ' Description:
  344. ' wait for dialog box with string argument for caption and
  345. ' integer argument as estimate of time to keep trying before
  346. ' logging a failure
  347. '
  348. ' Parameters:
  349. ' s$ - caption of dialog to search for
  350. ' WaitTime% - max time to keep checking for dialog
  351. '
  352. ' Returns:
  353. ' nothing
  354. '
  355. ' Example:
  356. ' XWaitDialogBox "Done"
  357. '
  358. '
  359. SUB XWaitDialogBox(s$, WaitTime%) STATIC
  360. DIM hWnd%
  361. DIM fDone%
  362. DIM fFound%
  363. DIM ret%
  364. fDone = FALSE
  365. fFound = FALSE
  366. WHILE NOT fDone%
  367. ' class for dialogs created by windows is gsDialogClass$
  368. ' won't work if app creates special class for its dialogs
  369. hWnd% = FindWindow(gsDialogClass$,s$)
  370. IF hWnd% <> 0 THEN
  371. fFound = TRUE
  372. fDone = TRUE
  373. ELSE
  374. SLEEP 1
  375. WaitTime% = WaitTime% - 1
  376. IF WaitTime% <= 0 THEN
  377. fDone = TRUE
  378. END IF
  379. END IF
  380. WEND
  381. IF NOT fFound% THEN
  382. XLogFailure "FAIL """ + s$ + """ dialogbox not found"
  383. END IF
  384. END SUB
  385. ' **********************************************************
  386. ' ***************** Dialog: Button Subroutines *************
  387. ' **********************************************************
  388. '
  389. ' BButtonExists(stButtonName$)
  390. '
  391. ' Description:
  392. ' This procedure checks to see if the specified button
  393. ' exists or not.
  394. '
  395. ' Parameters:
  396. ' stButtonName$ = button to be checked.
  397. '
  398. ' Returns:
  399. ' TRUE if button exists, FALSE if button does not exist.
  400. '
  401. ' Example:
  402. ' fExists% = BButtonExists("OK")
  403. '
  404. FUNCTION BButtonExists%(stButtonName$) STATIC
  405. BButtonExists = WButtonExists(stButtonName$) <> 0
  406. END FUNCTION
  407. '
  408. ' XButtonExists (stButtonName$)
  409. '
  410. ' Description:
  411. ' Reports error if button does not exist in active window.
  412. '
  413. ' Parameters:
  414. ' stButtonName$ - button to be found.
  415. '
  416. ' Returns:
  417. ' nothing
  418. '
  419. ' Example:
  420. ' XButtonExists "Cancel"
  421. '
  422. '
  423. '
  424. SUB XButtonExists(stButton$) STATIC
  425. IF BButtonExists(stButton$) = 0 THEN
  426. XLogFailure stButton$ + " does not Exist"
  427. END IF
  428. END SUB
  429. '
  430. ' XButtonNotExists (stButtonName$)
  431. '
  432. ' Description:
  433. ' Reports error if button Exists in active window.
  434. '
  435. ' Parameters:
  436. ' stButtonName$ - button to not be found.
  437. '
  438. ' Returns:
  439. ' nothing
  440. '
  441. ' Example:
  442. ' XButtonNotExists "Cancel"
  443. '
  444. '
  445. '
  446. SUB XButtonNotExists(stButton$) STATIC
  447. IF BButtonExists(stButton$) THEN
  448. XLogFailure stButton$ + " Exists"
  449. END IF
  450. END SUB
  451. '
  452. ' BButtonEnabled(stButtonName$)
  453. '
  454. ' Description:
  455. ' This procedure checks to see if the specified button
  456. ' is enabled or not.
  457. '
  458. ' Parameters:
  459. ' stButtonName$ - button to be checked.
  460. '
  461. ' Returns:
  462. ' TRUE if button enabled, FALSE if button not enabled.
  463. '
  464. ' Example:
  465. ' fEnabled% = BButtonEnabled("OK")
  466. '
  467. FUNCTION BButtonEnabled%(stButtonName$) STATIC
  468. BButtonEnabled = WButtonEnabled(stButtonName$) <> 0
  469. END FUNCTION
  470. '
  471. ' XButtonEnabled (stButtonName$)
  472. '
  473. ' Description:
  474. ' Reports error if button is not Enabled.
  475. '
  476. ' Parameters:
  477. ' stButtonName$ - button to be checked.
  478. '
  479. ' Returns:
  480. ' nothing
  481. '
  482. ' Example:
  483. ' XButtonEnabled "Cancel"
  484. '
  485. '
  486. SUB XButtonEnabled(stButton$) STATIC
  487. XButtonExists stButton$
  488. IF BButtonEnabled(stButton$) = 0 THEN
  489. XLogFailure stButton$ + " is not Enabled"
  490. END IF
  491. END SUB
  492. '
  493. ' XButtonNotEnabled (stButtonName$)
  494. '
  495. ' Description:
  496. ' Reports error if button is Enabled.
  497. '
  498. ' Parameters:
  499. ' stButtonName$ - button to be checked.
  500. '
  501. ' Returns:
  502. ' nothing
  503. '
  504. ' Example:
  505. ' XButtonNotEnabled "Cancel"
  506. '
  507. '
  508. SUB XButtonNotEnabled(stButton$) STATIC
  509. XButtonExists stButton$
  510. IF BButtonEnabled(stButton$) THEN
  511. XLogFailure stButton$ + " Enabled"
  512. END IF
  513. END SUB
  514. '
  515. ' XClickButton(stButtonName$)
  516. '
  517. ' Description:
  518. ' This procedure clicks the specified button in the
  519. ' currently active window.
  520. '
  521. ' Parameters:
  522. ' stButtonName$ - button to be clicked.
  523. '
  524. ' Returns:
  525. ' nothing
  526. '
  527. ' Example:
  528. ' XClickButton "OK"
  529. '
  530. '
  531. SUB XClickButton(stButtonName$) STATIC
  532. XButtonExists stButtonName$
  533. WButtonClick stButtonName$
  534. END SUB
  535. ' **********************************************************
  536. ' ************* Dialog: List Box Subroutines ***************
  537. ' **********************************************************
  538. '
  539. ' BListBoxExists(stListBox$)
  540. '
  541. ' Description:
  542. ' This procedure checks to see if the specified ListBox
  543. ' exists or not.
  544. '
  545. ' Parameters:
  546. ' stListBox$ - ListBox to be checked.
  547. '
  548. ' Returns:
  549. ' TRUE if ListBox exists, FALSE if ListBox does not exist.
  550. '
  551. ' Example:
  552. ' fExists% = BListBoxExists("cars")
  553. '
  554. FUNCTION BListBoxExists%(stListBox$) STATIC
  555. BListBoxExists = WListExists(stListBox$) <> 0
  556. END FUNCTION
  557. '
  558. ' XListBoxExists (stListBox$)
  559. '
  560. ' Description:
  561. ' Reports error if ListBox does not exist in active window.
  562. '
  563. ' Parameters:
  564. ' stListBox$ - ListBox to be found.
  565. '
  566. ' Returns:
  567. ' nothing
  568. '
  569. ' Example:
  570. ' XListBoxExists "Cars"
  571. '
  572. '
  573. SUB XListBoxExists(stListBox$) STATIC
  574. IF WListExists(stListBox$) = 0 THEN
  575. XLogFailure "ListBox " + stListBox$ + " does not Exist"
  576. END IF
  577. END SUB
  578. '
  579. ' XListBoxNotExists (stListBox$)
  580. '
  581. ' Description:
  582. ' Reports error if ListBox exists in active window.
  583. '
  584. ' Parameters:
  585. ' stListBox$ - ListBox not to be found.
  586. '
  587. ' Returns:
  588. ' nothing
  589. '
  590. ' Example:
  591. ' XListBoxNotExists "cars"
  592. '
  593. SUB XListBoxNotExists(stListBox$) STATIC
  594. IF WListExists(stListBox$) THEN
  595. XLogFailure "ListBox " + stListBox$ + " exists"
  596. END IF
  597. END SUB
  598. '
  599. ' XFocusListBox(stListBox$)
  600. '
  601. ' Description:
  602. ' This procedure puts focus to the specified ListBox in the
  603. ' currently active window.
  604. '
  605. ' Parameters:
  606. ' stListBox$ - ListBox to be given focus.
  607. '
  608. ' Returns:
  609. ' nothing
  610. '
  611. ' Example:
  612. ' XFocusListBox "&Files:"
  613. '
  614. SUB XFocusListBox(stListBox$) STATIC
  615. IF WListExists(stListBox$) THEN
  616. WListItemClk stListBox$,1 'it now has focus
  617. ELSE
  618. XLogFailure "Could not put focus on " + stListBox$ + " ListBox"
  619. END IF
  620. END SUB
  621. '
  622. ' IGetListBoxItemCount%(stListBox$)
  623. '
  624. ' Description:
  625. ' Returns the number of items in listbox stListBox$.
  626. '
  627. ' Parameters:
  628. ' stListBox$ - ListBox to get item count from
  629. '
  630. ' Returns:
  631. ' Int - List box item count
  632. '
  633. ' Example:
  634. ' num% = IGetListBoxItemCount ("cars")
  635. '
  636. '
  637. FUNCTION IGetListBoxItemCount%(stListBox$) STATIC
  638. XListBoxExists stListBox$
  639. IGetListBoxItemCount = WListCount(stListBox$)
  640. END FUNCTION
  641. '
  642. ' BListBoxItemExists%(stListBox$, stListBoxItem$)
  643. '
  644. ' Description:
  645. ' Returns true if list box item exists, false otherwise.
  646. '
  647. ' Parameters:
  648. ' stListBox$- ListBox to look in
  649. ' stListBoxItem$ - Item to look for
  650. '
  651. ' Returns:
  652. ' Int - 0 if item does not exist, positive val otherwise
  653. '
  654. ' Example:
  655. ' flag% = BListBoxItemExists ("&Files:","FOO.C")
  656. '
  657. '
  658. FUNCTION BListBoxItemExists%(stListBox$, stListBoxItem$) STATIC
  659. BListBoxItemExists = WListItemExists (stListBox$, stListBoxItem$) <> 0
  660. END FUNCTION
  661. '
  662. ' XListBoxItemExists(stListBox$, stListBoxItem$)
  663. '
  664. ' Description:
  665. ' Logs failure if list box item does not exist
  666. '
  667. ' Parameters:
  668. ' stListBox$- ListBox to look in
  669. ' stListBoxItem$ - Item to look for
  670. '
  671. ' Returns:
  672. ' nothing
  673. '
  674. ' Example:
  675. ' XListBoxItemExists "&Files:","FOO.C"
  676. '
  677. '
  678. SUB XListBoxItemExists (stListBox$, stListBoxItem$) STATIC
  679. XListBoxExists stListBox$
  680. IF WListItemExists (stListBox$, stListBoxItem$) = 0 THEN
  681. XLogFailure "ListBoxItem " + stListBoxItem$ + " does not exist"
  682. END IF
  683. END SUB
  684. '
  685. ' XListBoxItemNotExists(stListBox$, stListBoxItem$)
  686. '
  687. ' Description:
  688. ' Logs failure if list box item exists
  689. '
  690. ' Parameters:
  691. ' stListBox$ - ListBox to look in
  692. ' stListBoxItem$ - Item to look for
  693. '
  694. ' Returns:
  695. ' nothing
  696. '
  697. ' Example:
  698. ' XListBoxItemNotExists "&Files:","FOO.C"
  699. '
  700. '
  701. SUB XListBoxItemNotExists (stListBox$, stListBoxItem$) STATIC
  702. XListBoxExists stListBox$
  703. IF WListItemExists (stListBox$, stListBoxItem$) <> 0 THEN
  704. XLogFailure "ListBoxItem " + stListBoxItem$ + " exists"
  705. END IF
  706. END SUB
  707. '
  708. ' XClickListBoxItem(stListBox$, stListBoxItem$)
  709. '
  710. ' Description:
  711. ' Clicks on list box item
  712. '
  713. ' Parameters:
  714. ' stListBox$ - ListBox to look in
  715. ' stListBoxItem$ - Item to click on
  716. '
  717. ' Returns:
  718. ' nothing
  719. '
  720. ' Example:
  721. ' XClickListBoxItem "&Files:","FOO.C"
  722. '
  723. '
  724. SUB XClickListBoxItem (stListBox$, stListBoxItem$) STATIC
  725. XListBoxExists stListBox$
  726. XListBoxItemExists stListBox$, stListBoxItem$
  727. WListItemClkT stListBox$, stListBoxItem$
  728. END SUB
  729. '
  730. ' XDblClickListBoxItem% (stListBox$, stListBoxItem$)
  731. '
  732. ' Description:
  733. ' Clicks on list box item
  734. '
  735. ' Parameters:
  736. ' stListBox$ - ListBox to look in
  737. ' stListBoxItem$ - Item to click on
  738. '
  739. ' Returns:
  740. ' nothing
  741. '
  742. ' Example:
  743. ' XDblClickListBoxItem "&Files:","FOO.C"
  744. '
  745. '
  746. SUB XDblClickListBoxItem (stListBox$, stListBoxItem$) STATIC
  747. XListBoxExists stListBox$
  748. XListBoxItemExists stListBox$, stListBoxItem$
  749. WListItemDblClkT stListBox$, stListBoxItem$
  750. END SUB
  751. '
  752. ' SGetListBoxItemText (stListBox$)
  753. '
  754. ' Description:
  755. ' Returns currently selected list box item
  756. '
  757. ' Parameters:
  758. ' stListBox$ is the listbox to get item from
  759. '
  760. ' Returns:
  761. ' ListBox Item string
  762. '
  763. ' Example:
  764. ' a$ = SGetListBoxItemText ("&User List:")
  765. '
  766. '
  767. FUNCTION SGetListBoxItemText$(stListBox$) STATIC
  768. XListBoxExists stListBox$
  769. SGetListBoxItemText = ListText(stListBox$)
  770. END FUNCTION
  771. ' **********************************************************
  772. ' ************* Dialog: Combo Box Subroutines **************
  773. ' **********************************************************
  774. '
  775. ' BComboBoxExists%(stComboBox$)
  776. '
  777. ' Description:
  778. ' This procedure checks to see if the specified ComboBox
  779. ' exists or not.
  780. '
  781. ' Parameters:
  782. ' stComboBox$ = ComboBox to be checked.
  783. '
  784. ' Returns:
  785. ' TRUE if ComboBox exists.
  786. ' FALSE if ComboBox does not exist.
  787. '
  788. ' Example:
  789. ' fExists% = BComboBoxExists("&File")
  790. '
  791. FUNCTION BComboBoxExists%(stComboBox$) STATIC
  792. BComboBoxExists = WComboExists(stComboBox$) <> 0
  793. END FUNCTION
  794. '
  795. ' XComboBoxExists (stComboBox$)
  796. '
  797. ' Description:
  798. ' Reports error if ComboBox does not exist in active window.
  799. '
  800. ' Parameters:
  801. ' stComboBox$ - ComboBox to be found.
  802. '
  803. ' Returns:
  804. ' nothing
  805. '
  806. ' Example:
  807. ' XComboBoxExists "&File"
  808. '
  809. '
  810. SUB XComboBoxExists(stComboBox$) STATIC
  811. IF WComboExists(stComboBox$) = 0 THEN
  812. XLogFailure "ComboBox " + stComboBox$ + " does not Exist"
  813. END IF
  814. END SUB
  815. '
  816. ' XComboBoxNotExists (stComboBox$)
  817. '
  818. ' Description:
  819. ' Reports error if ComboBox exists in active window.
  820. '
  821. ' Parameters:
  822. ' stComboBox$ - ComboBox not to be found.
  823. '
  824. ' Returns:
  825. ' nothing
  826. '
  827. ' Example:
  828. ' XComboBoxNotExists "&File"
  829. '
  830. SUB XComboBoxNotExists(stComboBox$) STATIC
  831. IF WComboExists(stComboBox$) THEN
  832. XLogFailure "ComboBox " + stComboBox$ + " exists"
  833. END IF
  834. END SUB
  835. '
  836. ' XFocusComboBox(stComboBox$)
  837. '
  838. ' Description:
  839. ' This procedure puts focus to the specified ComboBox in the
  840. ' currently active window.
  841. '
  842. ' Parameters:
  843. ' stComboBox$ = ComboBox to be given focus.
  844. '
  845. ' Returns:
  846. ' nothing
  847. '
  848. ' Example:
  849. ' XFocusComboBox("&Files:")
  850. '
  851. SUB XFocusComboBox(stComboBox$) STATIC
  852. IF WComboExists(stComboBox$) THEN
  853. WComboItemClk stComboBox$,1 'it now has focus
  854. ELSE
  855. XLogFailure "Could not put focus on " + stComboBox$ + " ComboBox"
  856. END IF
  857. END SUB
  858. '
  859. ' IWGetComboBoxItemCount%(stComboBox$)
  860. '
  861. ' Description:
  862. ' Returns the number of items in ComboBox stComboBox$.
  863. '
  864. ' Parameters:
  865. ' stComboBox$ - ComboBox to get item count from
  866. '
  867. ' Returns:
  868. ' Int - Combo box item count
  869. '
  870. ' Example:
  871. ' num% = WComboBoxItemCount ()
  872. '
  873. '
  874. FUNCTION IGetComboBoxItemCount%(stComboBox$) STATIC
  875. XComboBoxExists stComboBox$
  876. IGetComboBoxItemCount = WComboCount(stComboBox$)
  877. END FUNCTION
  878. '
  879. ' BComboBoxItemExists%(stComboBox$, stComboBoxItem$)
  880. '
  881. ' Description:
  882. ' Returns true if Combo box item exists, false otherwise.
  883. '
  884. ' Parameters:
  885. ' stComboBox$ - ComboBox to look in
  886. ' stComboBoxItem$ - Item to look for
  887. '
  888. ' Returns:
  889. ' Int - 0 if item does not exist, positive val otherwise
  890. '
  891. ' Example:
  892. ' flag% = BComboBoxItemExists("&Files","FOO.C")
  893. '
  894. FUNCTION BComboBoxItemExists%(stComboBox$, stComboBoxItem$) STATIC
  895. BComboBoxItemExists = WComboItemExists (stComboBox$, stComboBoxItem$) <> 0
  896. END FUNCTION
  897. '
  898. ' XComboBoxItemExists(stComboBox$, stComboBoxItem$)
  899. '
  900. ' Description:
  901. ' Logs failure if combo box item does not exist
  902. '
  903. ' Parameters:
  904. ' stComboBox$ - ComboBox to look in
  905. ' stComboBoxItem$ - Item to look for
  906. '
  907. ' Returns:
  908. ' nothing
  909. '
  910. ' Example:
  911. ' XComboBoxItemExists "&Files","FOO.C"
  912. '
  913. '
  914. SUB XComboBoxItemExists (stComboBox$, stComboBoxItem$) STATIC
  915. XComboBoxExists stComboBox$
  916. IF WComboItemExists (stComboBox$, stComboBoxItem$) = 0 THEN
  917. XLogFailure "ComboBoxItem " + stComboBoxItem$ + " does not exist"
  918. END IF
  919. END SUB
  920. '
  921. ' XComboBoxItemNotExists(stComboBox$, stComboBoxItem$)
  922. '
  923. ' Description:
  924. ' Logs failure if combo box item exists
  925. '
  926. ' Parameters:
  927. ' stComboBox$ - ComboBox to look in
  928. ' stComboBoxItem$ - Item to look for
  929. '
  930. ' Returns:
  931. ' nothing
  932. '
  933. ' Example:
  934. ' XComboBoxItemNotExists "&Files","FOO.C"
  935. '
  936. '
  937. SUB XComboBoxItemNotExists (stComboBox$, stComboBoxItem$) STATIC
  938. XComboBoxExists stComboBox$
  939. IF WComboItemExists (stComboBox$, stComboBoxItem$) THEN
  940. XLogFailure "ComboBoxItem " + stComboBoxItem$ + " exists"
  941. END IF
  942. END SUB
  943. '
  944. ' XClickComboBoxItem(stComboBox$, stComboBoxItem$)
  945. '
  946. ' Description:
  947. ' Clicks on Combo box item
  948. '
  949. ' Parameters:
  950. ' stComboBox$ - ComboBox to look in
  951. ' stComboBoxItem$ - Item to click on
  952. '
  953. ' Returns:
  954. ' nothing
  955. '
  956. ' Example:
  957. ' XClickComboBoxItem "&Files","FOO.C"
  958. '
  959. '
  960. SUB XClickComboBoxItem (stComboBox$, stComboBoxItem$) STATIC
  961. XComboBoxExists stComboBox$
  962. XComboBoxItemExists stComboBox$,stComboBoxItem$
  963. WComboItemClkT stComboBox$, stComboBoxItem$
  964. END SUB
  965. '
  966. ' XDblClickComboBoxItem% (stComboBox$, stComboBoxItem$)
  967. '
  968. ' Description:
  969. ' Clicks on combo box item
  970. '
  971. ' Parameters:
  972. ' stComboBox$ - ComboBox to look in
  973. ' stComboBoxItem$ - Item to click on
  974. '
  975. ' Returns:
  976. ' nothing
  977. '
  978. ' Example:
  979. ' XDblClickComboBoxItem "&Files","FOO.C"
  980. '
  981. '
  982. SUB XDblClickComboBoxItem (stComboBox$, stComboBoxItem$) STATIC
  983. XComboBoxExists stComboBox$
  984. XComboBoxItemExists stComboBox$,stComboBoxItem$
  985. WComboItemDblClkT stComboBox$, stComboBoxItem$
  986. END SUB
  987. '
  988. ' StGetComboBoxItemText (stComboBox$)
  989. '
  990. ' Description:
  991. ' Returns currently selected Combo box item
  992. '
  993. ' Parameters:
  994. ' stComboBox$ is the ComboBox to get item from
  995. '
  996. ' Returns:
  997. ' ComboBox Item string
  998. '
  999. ' Example:
  1000. ' a$ = SGetComboBoxItemText ("&User List:")
  1001. '
  1002. FUNCTION SGetComboBoxItemText$(stComboBox$) STATIC
  1003. XComboBoxExists stComboBox$
  1004. XComboBoxItemExists stComboBox$,stComboBoxItem$
  1005. SGetComboBoxItemText = ComboText(stComboBox$)
  1006. END FUNCTION
  1007. ' **********************************************************
  1008. ' ************* Dialog: Check Box Subroutines **************
  1009. ' **********************************************************
  1010. '
  1011. ' BCheckBoxExists(stCheckBox$)
  1012. '
  1013. ' Description:
  1014. ' This procedure checks to see if the specified CheckBox
  1015. ' exists or not.
  1016. '
  1017. ' Parameters:
  1018. ' stCheckBox$ = CheckBox to be checked.
  1019. '
  1020. ' Returns:
  1021. ' TRUE if CheckBox exists.
  1022. ' FALSE if CheckBox does not exist.
  1023. '
  1024. ' Example:
  1025. ' fExists% = BCheckBoxExists("&Delete")
  1026. '
  1027. FUNCTION BCheckBoxExists%(stCheckBox$) STATIC
  1028. BCheckBoxExists = WCheckExists(stCheckBox$) <> 0
  1029. END FUNCTION
  1030. '
  1031. ' XCheckBoxExists (stCheckBox$)
  1032. '
  1033. ' Description:
  1034. ' Reports error if CheckBox does not exist in active window.
  1035. '
  1036. ' Parameters:
  1037. ' stCheckBox$ - CheckBox to be found.
  1038. '
  1039. ' Returns:
  1040. ' nothing
  1041. '
  1042. ' Example:
  1043. ' XCheckBoxExists "&Delete"
  1044. '
  1045. SUB XCheckBoxExists(stCheckBox$) STATIC
  1046. IF BCheckBoxExists(stCheckBox$) = 0 THEN
  1047. XLogFailure "CheckBox " + stCheckBox$ + " does not Exist"
  1048. END IF
  1049. END SUB
  1050. '
  1051. ' XCheckBoxNotExists (stCheckBox$)
  1052. '
  1053. ' Description:
  1054. ' Reports error if CheckBox Exists in active window.
  1055. '
  1056. ' Parameters:
  1057. ' stCheckBox$ - CheckBox to not be found.
  1058. '
  1059. ' Returns:
  1060. ' nothing
  1061. '
  1062. ' Example:
  1063. ' XCheckBoxNotExists "&Delete"
  1064. '
  1065. '
  1066. SUB XCheckBoxNotExists(stCheckBox$) STATIC
  1067. IF BCheckBoxExists(stCheckBox$) THEN
  1068. XLogFailure "CheckBox " + stCheckBox$ + " Exists"
  1069. END IF
  1070. END SUB
  1071. '
  1072. ' BCheckBoxChecked(stCheckBox$)
  1073. '
  1074. ' Description:
  1075. ' This procedure checks the state of checkbox
  1076. '
  1077. ' Parameters:
  1078. ' stCheckBox$ = CheckBox to check state of.
  1079. '
  1080. ' Returns:
  1081. ' -1(true) if the check box is checked.
  1082. ' 0(false) if the check box is not checked.
  1083. '
  1084. ' Example:
  1085. ' state% = BCheckBoxChecked("Special")
  1086. '
  1087. FUNCTION BCheckBoxChecked%(stCheckBox$) STATIC
  1088. BCheckBoxChecked = WCheckState(stCheckBox$) <> 0
  1089. END FUNCTION
  1090. '
  1091. ' XCheckBoxChecked(stCheckBox$)
  1092. '
  1093. ' Description:
  1094. ' This procedure checks the state of checkbox
  1095. '
  1096. ' Parameters:
  1097. ' stCheckBox$ = CheckBox to check state of.
  1098. '
  1099. ' Returns:
  1100. ' -1(true) if the check box is checked.
  1101. ' 0(false) if the check box is not checked.
  1102. '
  1103. ' Example:
  1104. ' XCheckBoxChecked "Special"
  1105. '
  1106. SUB XCheckBoxChecked(stCheckBox$) STATIC
  1107. XCheckBoxExists stCheckBox$
  1108. IF BCheckBoxChecked(stCheckBox$) = 0 THEN
  1109. XLogFailure "CheckBox " + stCheckBox$ + " is not checked"
  1110. END IF
  1111. END SUB
  1112. '
  1113. ' XCheckBoxNotChecked(stCheckBox$)
  1114. '
  1115. ' Description:
  1116. ' This procedure checks the state of checkbox
  1117. '
  1118. ' Parameters:
  1119. ' stCheckBox$ = CheckBox to check state of.
  1120. '
  1121. ' Returns:
  1122. ' -1(true) if the check box is checked.
  1123. ' 0(false) if the check box is not checked.
  1124. '
  1125. ' Example:
  1126. ' XCheckBoxNotChecked "Special"
  1127. '
  1128. SUB XCheckBoxNotChecked(stCheckBox$) STATIC
  1129. XCheckBoxExists stCheckBox$
  1130. IF BCheckBoxChecked(stCheckBox$) THEN
  1131. XLogFailure "CheckBox " + stCheckBox$ + " is checked"
  1132. END IF
  1133. END SUB
  1134. '
  1135. ' BCheckBoxEnabled(stCheckBox$)
  1136. '
  1137. ' Description:
  1138. ' This procedure checks to see if the specified CheckBox
  1139. ' is enabled or not.
  1140. '
  1141. ' Parameters:
  1142. ' stCheckBox$ = CheckBox to be checked.
  1143. '
  1144. ' Returns:
  1145. ' TRUE if CheckBox enabled.
  1146. ' FALSE if CheckBox not enabled.
  1147. '
  1148. ' Example:
  1149. ' fEnabled% = BCheckBoxEnabled("&Delete")
  1150. '
  1151. FUNCTION BCheckBoxEnabled%(stCheckBox$) STATIC
  1152. BCheckBoxEnabled = WCheckEnabled(stCheckBox$) <> 0
  1153. END FUNCTION
  1154. '
  1155. ' XCheckBoxEnabled (stCheckBox$)
  1156. '
  1157. ' Description:
  1158. ' Reports error if CheckBox is not Enabled.
  1159. '
  1160. ' Parameters:
  1161. ' stCheckBox$ - CheckBox to be checked.
  1162. '
  1163. ' Returns:
  1164. ' nothing
  1165. '
  1166. ' Example:
  1167. ' XCheckBoxEnabled "&Delete"
  1168. '
  1169. '
  1170. SUB XCheckBoxEnabled(stCheckBox$) STATIC
  1171. XCheckBoxExists(stCheckBox$)
  1172. IF BCheckBoxEnabled(stCheckBox$) = 0 THEN
  1173. XLogFailure "CheckBox " + stCheckBox$ + " is not Enabled"
  1174. END IF
  1175. END SUB
  1176. '
  1177. ' XCheckBoxNotEnabled (stCheckBox$)
  1178. '
  1179. ' Description:
  1180. ' Reports error if CheckBox is Enabled.
  1181. '
  1182. ' Parameters:
  1183. ' stCheckBox$ - CheckBox to be checked.
  1184. '
  1185. ' Returns:
  1186. ' nothing
  1187. '
  1188. ' Example:
  1189. ' XCheckBoxNotEnabled "&Delete"
  1190. '
  1191. SUB XCheckBoxNotEnabled(stCheckBox$) STATIC
  1192. XCheckBoxExists(stCheckBox$)
  1193. IF BCheckBoxEnabled(stCheckBox$) THEN
  1194. XLogFailure "CheckBox " + stCheckBox$ + " is Enabled"
  1195. END IF
  1196. END SUB
  1197. '
  1198. ' XClickCheckBox(stCheckBox$)
  1199. '
  1200. ' Description:
  1201. ' This procedure clicks the specified CheckBox in the
  1202. ' currently active window.
  1203. '
  1204. ' Parameters:
  1205. ' stCheckBox$ = CheckBox to be clicked.
  1206. '
  1207. ' Returns:
  1208. ' nothing
  1209. '
  1210. ' Example:
  1211. ' XClickCheckBox "&Delete"
  1212. '
  1213. SUB XClickCheckBox(stCheckBox$) STATIC
  1214. XCheckBoxExists stCheckBox$
  1215. WCheckClick stCheckBox$
  1216. END SUB
  1217. ' **********************************************************
  1218. ' ************* Dialog: Edit Control Subroutines ***********
  1219. ' **********************************************************
  1220. '
  1221. ' XEditTextExists(stEditText$)
  1222. '
  1223. ' Description:
  1224. ' This procedure checks to see if the specified EditText
  1225. ' exists or not.
  1226. '
  1227. ' Parameters:
  1228. ' stEditText$ = EditText to be checked.
  1229. '
  1230. ' Returns:
  1231. ' TRUE if EditText exists.
  1232. ' FALSE if EditText does not exist.
  1233. '
  1234. ' Example:
  1235. ' XEditTextExists "File"
  1236. '
  1237. SUB XEditTextExists(stEditText$) STATIC
  1238. IF BEditTextExists(stEditText$) = 0 THEN
  1239. XLogFailure "Edit Text control " + stEditText$ + " does not exist"
  1240. END IF
  1241. END SUB
  1242. '
  1243. ' XEditTextNotExists(stEditTextNot$)
  1244. '
  1245. ' Description:
  1246. ' This procedure checks to see that the specified EditText
  1247. ' doesn't exist
  1248. '
  1249. ' Parameters:
  1250. ' stEditTextNot$ = EditText to be checked.
  1251. '
  1252. ' Example:
  1253. ' XEditTextNotExists "File"
  1254. '
  1255. SUB XEditTextNotExists(stEditTextNot$) STATIC
  1256. IF BEditTextExists(stEditTextNot$) THEN
  1257. XLogFailure "Edit Text control " + stEditTextNot$ + " exists"
  1258. END IF
  1259. END SUB
  1260. '
  1261. ' BEditTextExists(stEditText$)
  1262. '
  1263. ' Description:
  1264. ' This procedure checks to see if the specified EditText
  1265. ' exists or not.
  1266. '
  1267. ' Parameters:
  1268. ' stEditText$ = EditText to be checked.
  1269. '
  1270. ' Returns:
  1271. ' TRUE if EditText exists.
  1272. ' FALSE if EditText does not exist.
  1273. '
  1274. ' Example:
  1275. ' fExists% = BEditTextExists("File")
  1276. '
  1277. FUNCTION BEditTextExists%(stEditText$) STATIC
  1278. BEditTextExists = WEditExists(stEditText$) <> 0
  1279. END FUNCTION
  1280. '
  1281. ' StGetEditText (stEditCaption$)
  1282. '
  1283. ' Description:
  1284. ' Returns string in Edit box with caption stEditCaption$
  1285. ' Logs error if stEditCaption$ is not found, or if Edit control
  1286. ' is not found following stEditCaption$ in the tabbing order.
  1287. '
  1288. ' Parameters:
  1289. ' stEditCaption$ - Caption that is associated with edit control
  1290. '
  1291. ' Returns:
  1292. ' String that is in the Edit control
  1293. '
  1294. ' Example:
  1295. ' a$ = SGetEditText("&FileName:")
  1296. '
  1297. '
  1298. FUNCTION SGetEditText$(stEditCaption$) STATIC
  1299. XEditTextExists stEditCaption$
  1300. SGetEditText = EditText(stEditCaption$)
  1301. END FUNCTION
  1302. '
  1303. ' XSetEditText (stEditCaption$, stEditText$)
  1304. '
  1305. ' Description:
  1306. ' Puts string stEditText$ in Edit box with caption stEditCaption$
  1307. ' Logs error if stEditCaption$ is not found, or if Edit control
  1308. ' is not found following stEditCaption$ in the tabbing order.
  1309. '
  1310. ' Parameters:
  1311. ' stEditCaption$ - Caption that is associated with edit control
  1312. ' stEditText$ - Text to put in the Edit control
  1313. '
  1314. ' Returns:
  1315. ' nothing
  1316. '
  1317. ' Example:
  1318. ' XSetEditText "&FileName:", "calc.exe"
  1319. '
  1320. '
  1321. SUB XSetEditText (stEditCaption$, stEditText$) STATIC
  1322. XEditTextExists stEditCaption$
  1323. WEditSetText stEditCaption$, stEditText$
  1324. END SUB
  1325. ' **********************************************************
  1326. ' ************* Dialog: Option Button Subroutines ***********
  1327. ' **********************************************************
  1328. '
  1329. ' BOptionButtonExists(stOptionButton$)
  1330. '
  1331. ' Description:
  1332. ' This procedure checks to see if the specified OptionButton
  1333. ' exists or not.
  1334. '
  1335. ' Parameters:
  1336. ' stOptionButton$ = OptionButton to be checked.
  1337. '
  1338. ' Returns:
  1339. ' TRUE if OptionButton exists.
  1340. ' FALSE if OptionButton does not exist.
  1341. '
  1342. ' Example:
  1343. ' fExists% = BOptionButtonExists("Blue")
  1344. '
  1345. FUNCTION BOptionButtonExists%(stOptionButton$) STATIC
  1346. BOptionButtonExists = WOptionExists(stOptionButton$) <> 0
  1347. END FUNCTION
  1348. '
  1349. ' XOptionButtonExists (stOptionButton$)
  1350. '
  1351. ' Description:
  1352. ' Reports error if OptionButton does not exist in active window.
  1353. '
  1354. ' Parameters:
  1355. ' stOptionButton$ - OptionButton to be found.
  1356. '
  1357. ' Returns:
  1358. ' nothing
  1359. '
  1360. ' Example:
  1361. ' XOptionButtonExists "Blue"
  1362. '
  1363. SUB XOptionButtonExists(stOptionButton$) STATIC
  1364. IF BOptionButtonExists(stOptionButton$) = 0 THEN
  1365. XLogFailure "OptionButton " + stOptionButton$ + " does not Exist"
  1366. END IF
  1367. END SUB
  1368. '
  1369. ' XOptionButtonNotExists (stOptionButton$)
  1370. '
  1371. ' Description:
  1372. ' Reports error if OptionButton Exists in active window.
  1373. '
  1374. ' Parameters:
  1375. ' stOptionButton$ - OptionButton to not be found.
  1376. '
  1377. ' Returns:
  1378. ' nothing
  1379. '
  1380. ' Example:
  1381. ' XOptionButtonNotExists "Blue"
  1382. '
  1383. SUB XOptionButtonNotExists(stOptionButton$) STATIC
  1384. IF BOptionButtonExists(stOptionButton$) THEN
  1385. XLogFailure "OptionButton " + stOptionButton$ + " Exists"
  1386. END IF
  1387. END SUB
  1388. '
  1389. ' BOptionButtonEnabled(stOptionButton$)
  1390. '
  1391. ' Description:
  1392. ' This procedure checks to see if the specified OptionButton
  1393. ' is enabled or not.
  1394. '
  1395. ' Parameters:
  1396. ' stOptionButton$ = OptionButton to be checked.
  1397. '
  1398. ' Returns:
  1399. ' TRUE if OptionButton enabled.
  1400. ' FALSE if OptionButton not enabled.
  1401. '
  1402. ' Example:
  1403. ' fEnabled% = BOptionButtonEnabled("Blue")
  1404. '
  1405. FUNCTION BOptionButtonEnabled%(stOptionButton$) STATIC
  1406. BOptionButtonEnabled = WOptionEnabled(stOptionButton$) <> 0
  1407. END FUNCTION
  1408. '
  1409. ' XOptionButtonEnabled (stOptionButton$)
  1410. '
  1411. ' Description:
  1412. ' Reports error if OptionButton is not Enabled.
  1413. '
  1414. ' Parameters:
  1415. ' stOptionButton$ - OptionButton to be checked.
  1416. '
  1417. ' Returns:
  1418. ' nothing
  1419. '
  1420. ' Example:
  1421. ' XOptionButtonEnabled "Blue"
  1422. '
  1423. SUB XOptionButtonEnabled(stOptionButton$) STATIC
  1424. XOptionButtonExists stOptionButton$
  1425. IF BOptionButtonEnabled(stOptionButton$) = 0 THEN
  1426. XLogFailure "OptionButton " + stOptionButton$ + " is not Enabled"
  1427. END IF
  1428. END SUB
  1429. '
  1430. ' XOptionButtonNotEnabled (stOptionButton$)
  1431. '
  1432. ' Description:
  1433. ' Reports error if OptionButton is Enabled.
  1434. '
  1435. ' Parameters:
  1436. ' stOptionButton$ - OptionButton to be checked.
  1437. '
  1438. ' Returns:
  1439. ' nothing
  1440. '
  1441. ' Example:
  1442. ' XOptionButtonNotEnabled "Blue"
  1443. '
  1444. '
  1445. SUB XOptionButtonNotEnabled(stOptionButton$) STATIC
  1446. XOptionButtonExists stOptionButton$
  1447. IF BOptionButtonEnabled(stOptionButton$) THEN
  1448. XLogFailure "OptionButton " + stOptionButton$ + " Enabled"
  1449. END IF
  1450. END SUB
  1451. '
  1452. ' BOptionButtonChecked(stOptionButton$)
  1453. '
  1454. ' Description:
  1455. ' This procedure checks to see if the specified OptionButton
  1456. ' is Checked or not.
  1457. '
  1458. ' Parameters:
  1459. ' stOptionButton$ = OptionButton to be checked.
  1460. '
  1461. ' Returns:
  1462. ' TRUE if OptionButton Checked.
  1463. ' FALSE if OptionButton not Checked.
  1464. '
  1465. ' Example:
  1466. ' fChecked% = BOptionButtonChecked("Blue")
  1467. '
  1468. FUNCTION BOptionButtonChecked%(stOptionButton$) STATIC
  1469. BOptionButtonChecked = WOptionState(stOptionButton$) <> 0
  1470. END FUNCTION
  1471. '
  1472. ' XOptionButtonChecked (stOptionButton$)
  1473. '
  1474. ' Description:
  1475. ' Reports error if OptionButton is not Checked.
  1476. '
  1477. ' Parameters:
  1478. ' stOptionButton$ - OptionButton to be checked.
  1479. '
  1480. ' Returns:
  1481. ' nothing
  1482. '
  1483. ' Example:
  1484. ' XOptionButtonChecked "Blue"
  1485. '
  1486. SUB XOptionButtonChecked(stOptionButton$) STATIC
  1487. XOptionButtonExists stOptionButton$
  1488. IF BOptionButtonChecked(stOptionButton$) = 0 THEN
  1489. XLogFailure "OptionButton " + stOptionButton$ + " is not Checked"
  1490. END IF
  1491. END SUB
  1492. '
  1493. ' XOptionButtonNotChecked (stOptionButton$)
  1494. '
  1495. ' Description:
  1496. ' Reports error if OptionButton is Checked.
  1497. '
  1498. ' Parameters:
  1499. ' stOptionButton$ - OptionButton to be checked.
  1500. '
  1501. ' Returns:
  1502. ' nothing
  1503. '
  1504. ' Example:
  1505. ' XOptionButtonNotChecked "Blue"
  1506. '
  1507. '
  1508. SUB XOptionButtonNotChecked(stOptionButton$) STATIC
  1509. XOptionButtonExists stOptionButton$
  1510. IF BOptionButtonChecked(stOptionButton$) THEN
  1511. XLogFailure "OptionButton " + stOptionButton$ + " Checked"
  1512. END IF
  1513. END SUB
  1514. '
  1515. ' XClickOptionButton(stOptionButton$)
  1516. '
  1517. ' Description:
  1518. ' This procedure clicks the specified OptionButton in the
  1519. ' currently active window.
  1520. '
  1521. ' Parameters:
  1522. ' stOptionButton$ = OptionButton to be clicked.
  1523. '
  1524. ' Returns:
  1525. ' nothing
  1526. '
  1527. ' Example:
  1528. ' XClickOptionButton "Blue"
  1529. '
  1530. SUB XClickOptionButton(stOptionButton$) STATIC
  1531. XOptionButtonExists stOptionButton$
  1532. WOptionClick stOptionButton$
  1533. END SUB