home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form FileFrm1
- BackColor = &H00C0C0C0&
- Caption = "File Creation"
- ClientHeight = 3555
- ClientLeft = 1050
- ClientTop = 1755
- ClientWidth = 4185
- Height = 3960
- Left = 990
- LinkMode = 1 'Source
- LinkTopic = "Form1"
- ScaleHeight = 3555
- ScaleWidth = 4185
- Top = 1410
- Width = 4305
- Begin Frame Frame2
- BackColor = &H00C0C0C0&
- Caption = "File Status"
- Height = 1365
- Left = 480
- TabIndex = 7
- Top = 1980
- Width = 3345
- Begin Label Stat
- BackColor = &H00C0C0C0&
- Height = 180
- Index = 4
- Left = 1215
- TabIndex = 15
- Top = 1095
- Width = 1650
- End
- Begin Label Label4
- BackColor = &H00C0C0C0&
- Caption = "Error Code:"
- Height = 180
- Left = 90
- TabIndex = 11
- Top = 1095
- Width = 1050
- End
- Begin Label Stat
- BackColor = &H00C0C0C0&
- Height = 180
- Index = 3
- Left = 1215
- TabIndex = 14
- Top = 855
- Width = 1635
- End
- Begin Label Label3
- BackColor = &H00C0C0C0&
- Caption = "Handle:"
- Height = 270
- Left = 420
- TabIndex = 10
- Top = 825
- Width = 735
- End
- Begin Label Stat
- BackColor = &H00C0C0C0&
- Height = 210
- Index = 2
- Left = 1215
- TabIndex = 13
- Top = 585
- Width = 1635
- End
- Begin Label Label2
- BackColor = &H00C0C0C0&
- Caption = "Size:"
- Height = 285
- Left = 630
- TabIndex = 9
- Top = 585
- Width = 480
- End
- Begin Label Stat
- BackColor = &H00C0C0C0&
- Height = 225
- Index = 1
- Left = 1200
- TabIndex = 12
- Top = 300
- Width = 1635
- End
- Begin Label Label1
- BackColor = &H00C0C0C0&
- Caption = "Status:"
- Height = 195
- Left = 435
- TabIndex = 8
- Top = 300
- Width = 690
- End
- End
- Begin Frame Frame1
- BackColor = &H00C0C0C0&
- Caption = "File Function"
- Height = 1620
- Left = 480
- TabIndex = 0
- Top = 270
- Width = 3330
- Begin OptionButton FOpt
- BackColor = &H00C0C0C0&
- Caption = "FDelete"
- Height = 240
- Index = 5
- Left = 1065
- TabIndex = 16
- Top = 1320
- Width = 1125
- End
- Begin OptionButton FOpt
- BackColor = &H00C0C0C0&
- Caption = "FClose"
- Height = 210
- Index = 4
- Left = 1755
- TabIndex = 6
- Top = 1035
- Width = 1335
- End
- Begin OptionButton FOpt
- BackColor = &H00C0C0C0&
- Caption = "FCreate"
- Height = 210
- Index = 2
- Left = 210
- TabIndex = 4
- Top = 1020
- Width = 1155
- End
- Begin OptionButton FOpt
- BackColor = &H00C0C0C0&
- Caption = "FOpen"
- Height = 270
- Index = 3
- Left = 1755
- TabIndex = 5
- Top = 735
- Width = 1065
- End
- Begin OptionButton FOpt
- BackColor = &H00C0C0C0&
- Caption = "FUnique"
- Height = 285
- Index = 1
- Left = 210
- TabIndex = 3
- Top = 705
- Width = 1095
- End
- Begin TextBox Text1
- BackColor = &H00C0C0C0&
- Height = 375
- Left = 705
- TabIndex = 1
- Top = 270
- Width = 2295
- End
- Begin Label title
- BackColor = &H00C0C0C0&
- Caption = "File:"
- Height = 255
- Left = 120
- TabIndex = 2
- Top = 375
- Width = 495
- End
- End
- DefInt A-Z
- Dim FHandle As Integer
- Dim FErrc As Integer
- Dim OldNdx As Integer
- Sub Ffclose ()
- FErrc = FClose(FHandle)
- End Sub
- Sub FFCreate ()
- Fil$ = LTrim$(RTrim$(text1.text))
- FErrc = FCreat(Fil$, FHandle)
- End Sub
- Sub FFOpen ()
- Fil$ = LTrim$(RTrim$(text1.text))
- FErrc = FOpen(Fil$, FHandle)
- End Sub
- Sub ffunique ()
- Fil$ = "C:\" + Chr$(0) + Space$(15)
- FErrc = FUnique(Fil$, 32, FHandle)
- text1.text = LTrim$(RTrim$(Fil$))
- End Sub
- Sub FOpt_Click (Index As Integer)
- ' close any file we have open
- If FHandle > 0 Then
- errc = FClose(FHandle)
- End If
- Select Case Index
- Case 1
- Call ffunique
- Case 2
- If Len(text1.text) = 0 Then
- text1.text = "TEST.DOC"
- End If
- Call FFCreate
- Case 3
- If Len(text1.text) = 0 Then
- text1.text = "TEST.DOC"
- End If
- Call FFOpen
- Case 4
- If Len(text1.text) = 0 Then
- text1.text = "TEST.DOC"
- End If
- Call Ffclose
- Case 5
- If Len(text1.text) Then
- Fil$ = LTrim$(RTrim$(text1.text))
- Msg$ = "Do you really want do delete " + Fil$ + " ?"
- retc = MsgBox(Msg$, 4 + 48, "Warning")
- If retc = 6 Then
- FErrc = FDelete(Fil$)
- FHandle = 0
- End If
- End If
- End Select
- OldNdx = Index
- UpdateStatus
- End Sub
- Sub Form_Load ()
- OldNdx = 0
- End Sub
- Sub Form_Paint ()
- Call ConvexFrm(FileFrm1, 3)
- ConvexCtl Frame1, 2
- ConvexCtl Frame2, 2
- End Sub
- Sub UpdateStatus ()
- If FHandle Then
- Stat(1).Caption = "Open"
- lret& = FSizeH&(FHandle)
- Stat(2).Caption = Str$(lretc&)
- Stat(3).Caption = Str$(FHandle)
- Stat(4).Caption = Str$(FErrc)
- Else
- Stat(1).Caption = "Closed"
- Stat(2).Caption = Str$(0)
- Stat(3).Caption = Str$(0)
- Stat(4).Caption = "None"
- End If
- End Sub
-