home *** CD-ROM | disk | FTP | other *** search
/ Millennium Time Capsule / AC2000.BIN / disks / ac12disk / enchant / format.ter / format.bas < prev    next >
BASIC Source File  |  1998-11-02  |  3KB  |  104 lines

  1.  
  2. ' [FORMAT.BAS]
  3. ' This source document is apart of the ENhanCed Hisoft ApplicatioN toolkiT (ENCHANT)
  4. ' Developed by Matthew Bacon & Paul Jones, © 1997-1998 Matthew Bacon & Paul Jones
  5.  
  6. DEFINT a-z
  7. REM $option j150            ' Declare that you want to keep 150k of memory for ACC
  8. REM $include format.bh        ' Declare *.BH file created from resource file
  9. REM $include acc_tbox.bas    ' Request the file ACC_TBOX.BAS (DA version of TOOLBX_A.BAS)
  10. REM $include disk.bas        ' Request the file DISK.BAS
  11. REM $include curser.bas        ' Request the file CURSER.BAS
  12. REM $include error.bas        ' Request the file ERROR.BAS
  13.  
  14. CALL StartAccessory("Formatter v1.2",CURDIR$+"\FORMAT.RSC",0)
  15. CALL ENCHANT_ACCloop    ' Main program loop
  16.  
  17. ' These sub-routines are not used, but are required as they are declared
  18. ' within the GEM Toolkit
  19.  
  20. FUNCTION HandleFormClicks(BYVAL button,BYVAL clicks,BYVAL kstate,BYVAL x,BYVAL y)
  21. END FUNCTION
  22.  
  23. SUB WindowMessage
  24. END SUB
  25.  
  26. SUB HandleKeyboardEvent (BYVAL key_pressed,BYVAL kstate)
  27. END SUB
  28.  
  29. SUB TextWindLoop (keypressed)
  30. END SUB
  31.  
  32. FUNCTION HandleUserClose(BYVAL WindowHandle)
  33. END FUNCTION
  34.  
  35. SUB HandleUserMessages
  36. END SUB
  37.  
  38. SUB HandleUserKeys (ASCII$,key_pressed,kstate)
  39. END SUB
  40.  
  41. SUB HandleUserClicks (clicks,kstate,mx,my)
  42. END SUB
  43.  
  44.  
  45. SUB RelaySourceProgress (drive$,no_sectors,track,side)
  46. END SUB
  47.  
  48. SUB RelayDestProgress (drive$,no_sectors,track,side,copy)
  49. END SUB
  50.  
  51.  
  52. SUB ACCOpened    ' This sub-routine is used each time the DA is opened
  53. STATIC dummy
  54.  
  55. INCR dummy : IF dummy=1 THEN junk=xdialog (FORM_ABOUT,0,0,1,0)    ' Display dialog 1st time only
  56. junk=xdialog (FORM_MAIN,0,MAIN_QUIT,1,VARPTRS(closeFORM_MAIN))    ' Display dialog
  57. END SUB
  58.  
  59.  
  60. SUB closeFORM_MAIN
  61. STATIC drive$,sides,tracks,sectors,verify,button,result
  62.  
  63. SelectTree FORM_MAIN
  64. IF enquire_state(MAIN_A,mask_selected) THEN    ' This workdout which drive has been selected
  65.     drive$="A"
  66. ELSE
  67.     drive$="B"
  68. END IF
  69. IF getobj_shortcut(MAIN_1)=12 THEN
  70.     sides=1
  71. ELSE
  72.     sides=2
  73. END IF
  74. IF getobj_shortcut(MAIN_80)=12 THEN
  75.     tracks=80
  76. ELSE
  77.     tracks=81
  78. END IF
  79. IF getobj_shortcut(MAIN_9)=12 THEN
  80.     sectors=9
  81. ELSE
  82.     sectors=10
  83. END IF
  84. IF getobj_shortcut(MAIN_VERIFY)=14 THEN
  85.     verify=1
  86. ELSE
  87.     verify=0
  88. END IF
  89.  
  90. SELECT CASE CommonObj
  91. CASE MAIN_FORMAT 
  92.     ' Double check the user wants to format the disk!
  93.     button=form_alert(2,"[1][  "+MyProgram$+": |  Format disk in drive "+drive$+"? ][Continue|Cancel]")
  94.     SELECT CASE button
  95.     CASE 1
  96.         ' Using what we have worked out (how many sides etc.), format the disk! :)
  97.         result=FormatDisk (drive$,sectors,tracks,sides,verify)
  98.     END SELECT
  99. CASE MAIN_QUIT : Finished_DFlag=0    ' Exit the dialog loop
  100. END SELECT
  101. END SUB
  102.  
  103. '[*END OF FILE*]
  104.