VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx"
Begin VB.Form Form2 
   Caption         =   " FS Floppy Drive"
   ClientHeight    =   2250
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   2640
   Icon            =   "frmFloppyDrive.frx":0000
   LinkTopic       =   "Form2"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2250
   ScaleWidth      =   2640
   StartUpPosition =   1  'CenterOwner
   Begin VB.OptionButton Option3 
      Caption         =   "Floppy Disk Image File"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   162
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   120
      TabIndex        =   3
      Top             =   840
      Width           =   2295
   End
   Begin VB.OptionButton Option2 
      Caption         =   "B: (fd1)"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   162
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   1320
      TabIndex        =   2
      Top             =   240
      Width           =   1095
   End
   Begin VB.OptionButton Option1 
      Caption         =   "A: (fd0)"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   162
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   120
      TabIndex        =   1
      Top             =   240
      Width           =   1095
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Open"
      Height          =   375
      Left            =   1200
      TabIndex        =   0
      Top             =   1560
      Width           =   1095
   End
   Begin MSComDlg.CommonDialog CommonDialog1 
      Left            =   120
      Top             =   1440
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
      CancelError     =   -1  'True
   End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub Command1_Click()
If Option1.Value = True Then
   DriveName = "A:"
Else
   If Option2.Value = True Then
      DriveName = "B:"
   Else
      Call fsfdOpenImage
   End If
End If
If ImageFile = True Or Option3.Value = False Then
   If Form1.ReadSector(DriveName, 0, 1, BS()) <> 0 Then
      MsgBox ("Drive not ready or read error !"), 48, " Reading " + DriveName
      Exit Sub
   End If
   Form1.Show
   Unload Me
End If
End Sub

Private Sub fsfdOpenImage()
CommonDialog1.DialogTitle = "OPEN FS IMAGE FILE"
CommonDialog1.FileName = Chr(0)
CommonDialog1.Filter = "All files (*.*)|*.*|IMG files (*.img)|*.img|DAT files (*.dat)|*.dat|BIN files (*.bin)|*.bin"
CommonDialog1.Flags = OFN_FILEMUSTEXIST Or OFN_HIDEREADONLY Or OFN_EXPLORER
On Error Resume Next
CommonDialog1.ShowOpen
If Err = 0 Then
   ImageFileName = CommonDialog1.FileName
   ImageFileSize = FileLen(ImageFileName)
   If ImageFileSize < 1 Then
      ImageFileName = ""
   End If
Else
   If Err <> 32755 Then
      ImageFileName = ""
      GoTo ErrMsg
   End If
End If
If ImageFileName <> "" Then
   ImageFileSize = FileLen(ImageFileName)
   ImageFileCDateTime = FileDateTime(ImageFileName)
   Rem Form1.Label1.Caption = "FS Image File Name : " + ImageFileName + Chr$(13) + Chr$(10) + "FS Image File Size : " + CStr(ImageFileSize) + " bytes" + Chr$(13) + Chr$(10) + "Image File Date and Time : " + ImageFileCDateTime
   If (FileLen(ImageFileName) / 512) <> 2880 Then
      MsgBox ("FS Image file is not valid !"), 48, " Open SINGLIX FS Image"
      ImageFileName = ""
   Else
      ImageFile = True
   End If
End If
Exit Sub
ErrMsg:
Beep
MsgBox ("SINGLIX FS Image File could not open!..." + Chr$(13) + Chr$(13) + "Error Number: " + Str$(Err)), 48, "! ERROR !"
End Sub
