Category : BASIC Source Code
Archive   : VINST8.ZIP
Filename : RENAME_F.FRM

 
Output of file : RENAME_F.FRM contained in archive : VINST8.ZIP
VERSION 2.00
Begin Form Rename_File
BackColor = &H00C0C0C0&
BorderStyle = 1 'Fixed Single
Caption = "Rename File...."
ClipControls = 0 'False
ControlBox = 0 'False
ForeColor = &H00FF0000&
Height = 2040
Left = 120
LinkTopic = " "
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1635
ScaleWidth = 5760
Top = 1200
Width = 5880
Begin CommandButton OK_Cmd
Caption = "OK"
Default = -1 'True
Height = 345
Left = 2160
TabIndex = 1
Top = 1020
Width = 825
End
Begin TextBox Text1
Height = 345
Left = 2760
TabIndex = 0
Text = "Text1"
Top = 420
Width = 2565
End
Begin Label Label1
BackColor = &H00C0C0C0&
Caption = "Rename the current file as:"
ForeColor = &H00FF0000&
Height = 345
Left = 180
TabIndex = 2
Top = 450
Width = 2475
End
End
DefInt A-Z

Option Explicit

Sub Form_Load ()
Dim TmpTxt$
Dim ELetter%

BackColor = RGB(BKGNDGRAY, BKGNDGRAY, BKGNDGRAY)
gFrameWidth% = DEFAULTWIDTH

TmpTxt$ = gRenFile$
ELetter% = InStr(TmpTxt$, ".")
If ELetter% > 0 Then
TmpTxt$ = Mid$(TmpTxt$, 1, ELetter%) & "BKP"
Else
TmpTxt$ = TmpTxt$ & "BKP"
End If
Rename_File.Text1.Text = TmpTxt$


' -----------------------------------------------------
' Set fonts based on Windows version
' -----------------------------------------------------
On Error Resume Next
Rename_File.FontName = gFontName$
Me.Label1.FontName = gFontName$
Me.Text1.FontName = gFontName$

Me.OK_Cmd.FontName = gFontName$
On Error GoTo 0

End Sub

Sub Form_Paint ()
HighLight Rename_File.Label1, CTLRAISED
HighLight Rename_File.Text1, CTLRAISED
End Sub

Sub OK_Cmd_Click ()
Dim TmpTxt$, Msg$
Dim ELetter%, MBFlags%

TmpTxt$ = Rename_File.Text1.Text
TmpTxt$ = LTrim$(RTrim$(TmpTxt$))
ELetter% = InStr(TmpTxt$, ".")


' -----------------------------------------------------
' Check for possible bad file names....
' -----------------------------------------------------
If Len(TmpTxt$) > 12 Then
Msg$ = "The filename is too long for DOS ( > 11 characters)"
MBFlags% = MB_OK & MB_ICONINFORMATION
MsgBox Msg$, MBFlags%, "FILE NAME ERROR"
Rename_File.Text1.SetFocus
Exit Sub
ElseIf ELetter% > 9 Then
Msg$ = "The file name is too long for DOS ( > 8 characters)"
MBFlags% = MB_OK & MB_ICONINFORMATION
MsgBox Msg$, MBFlags%, "FILE NAME ERROR"
Rename_File.Text1.SetFocus
Exit Sub
ElseIf Len(TmpTxt$) - ELetter% > 3 Then
Msg$ = "The file extension is too long for DOS ( > 3 characters)"
MBFlags% = MB_OK & MB_ICONINFORMATION
MsgBox Msg$, MBFlags%, "FILE NAME ERROR"
Rename_File.Text1.SetFocus
Exit Sub
End If


gRenFile$ = UCase$(Rename_File.Text1.Text)
Unload Rename_File
End Sub

Sub Text1_KeyPress (KeyAscii As Integer)
If KeyAscii = 13 Then Rename_File.OK_Cmd.SetFocus
End Sub



  3 Responses to “Category : BASIC Source Code
Archive   : VINST8.ZIP
Filename : RENAME_F.FRM

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/