home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / d / d009_2 / 1.ddi / SAMPLES / DOCS / FILETEST.MS$ / FILETEST.bin
Encoding:
Text File  |  1992-02-03  |  1.8 KB  |  65 lines

  1. '************************** FILETEST.MST *********************************
  2. 'Demonstrates:  Some of the file-handling procedures of FastTest.
  3. '
  4. 'Required Files: FASTTEST.INC, NOTEPAD.EXE
  5. '
  6. 'Uses: FASTTEST
  7. '
  8. 'Complexity Level: INTRODUCTORY
  9. '
  10. 'Notes: Assumes disk is in drive A:
  11. '
  12. '*************************************************************************
  13.  
  14. '$INCLUDE 'FASTTEST.INC'
  15.  
  16. XSetLogOptions LOG_SCREEN    '*** Output errors to the viewport
  17. Viewport Clear               '*** Clear the viewport screen
  18. XSetTerminate FALSE          '*** Continue after a failure is logged
  19.  
  20. XLogBanner "Starting Notepad Test"
  21.  
  22. XChangeDrive "A:"            '*** Change current drive to A:
  23. '*** If the file TESTOUT.TXT already exists on A:, delete it:
  24.  
  25. XDeleteFileIfExists "testout.txt"
  26.  
  27. '*** Create a baseline comparison file (base.txt) on A:.
  28. '*** XCreateFile creates the file and inserts the first line
  29. '*** XAppendFile appends the second line to the file
  30.  
  31. XCreateFile "base.txt","First line of text"
  32. XAppendFile "base.txt","Ssecond line of text"
  33.  
  34. '*** Start Notepad and type two lines of text into the window:
  35.  
  36. XStartApp "notepad.exe", ""
  37. XEnter "First line of text"
  38. XEnter "Second line of text"
  39.  
  40. XAlt "f"                     '*** Open the File menu
  41. XKey "s"                     '*** Choose the Save command
  42.  
  43. XText "testout.txt"          '*** Enter the filename to save as
  44. XEnter ""                    '*** Press Enter to select the OK button
  45.  
  46. '*** Exit Notepad by entering Alt+f, then x:
  47.  
  48. XAlt "f"
  49. XKey "x"
  50.  
  51. '*** Compare base.txt and testout.txt and
  52. '*** log an error if they are not identical:
  53.  
  54. XFileCmp "base.txt","testout.txt"
  55.  
  56. '*** Delete both files - they are no longer needed
  57.  
  58. XDeleteFile "testout.txt"
  59. XDeleteFile "base.txt"
  60.  
  61. XChangeDrive "C:"             '*** Change current drive back to C:
  62.  
  63. END
  64.  
  65.