I got bored so I wrote this simple utility to edit the qb64 file menu recent filename list:
Code: (Select All)
Rem Utility to edit recent history list in QB64.
Rem $dynamic
DefInt A-Z
Dim Shared RecentList(1) As String
ReDim RecentList(1024) As String
File$ = "c:\qb64pe\internal\temp\recent.bin"
Close
If _FileExists(File$) = 0 Then
Open File$ For Output As #1
Print #1, "": Print #1, ""
Print "Recent.bin init."
End If
Close
Open File$ For Input As #1
Do
If EOF(1) Then Exit Do
Line Input #1, Line$
Line$ = LTrim$(RTrim$(Line$))
If Len(Line$) Then
LineNum = LineNum + 1
RecentList(LineNum) = Line$
End If
Loop
Color 15
Print "Recent.bin loaded."
Do
Color 15
Print "Recent editor"
Color 14
Print "(A)dd to list"
Print "(C)lear list"
Print "(E)dit value"
Print "(L)ist values"
Print "(R)emove value"
Print "(Q)uit and save"
Color 15
Print "Enter option?";
Do
_Limit 100
Inp$ = InKey$
If Len(Inp$) Then
Inp$ = UCase$(Inp$)
Select Case Inp$
Case "A"
Print "A"
Print "Enter filename to add:"
Print "?";
Line Input Line$
If Len(Line$) Then
If _FileExists(Line$) Then
LineNum = LineNum + 1
RecentList(LineNum) = Line$
Print "Value added."
Else
Print "File not found."
End If
Else
Print "File not found."
End If
Exit Do
Case "C"
Print "C"
LineNum = 0
Print "List Cleared."
Case "L"
Print "L"
Found = 0
For Linen = 1 To LineNum
Count$ = LTrim$(Str$(Linen))
Print "("; Count$; ")"; RecentList(Linen)
Found = -1
Next
If Found = 0 Then
Print "No values found."
End If
Exit Do
Case "E"
Print "E"
If LineNum > 0 Then
Count$ = LTrim$(Str$(Linen))
Print "Enter line to edit(1-"; Count$; ")";
Input Linen
If Linen > 0 And Linen <= LineNum Then
Print "Enter filename:"
Print "?";
Line Input Line$
If Len(Line$) Then
If _FileExists(Line$) Then
RecentList(Linen) = Line$
Print "Value edited."
Else
Print "File not found."
End If
Else
Print "File not found."
End If
Else
Print "Value not found."
End If
Else
Print "No values found."
End If
Exit Do
Case "R"
Print "R"
If LineNum > 0 Then
Count$ = LTrim$(Str$(LineNum))
Print "Enter line to remove(1-"; Count$; ")";
Input Linen
If Linen > 0 And Linen <= LineNum Then
For Linex = Linen To LineNum - 1
RecentList(Linex) = RecentList(Linex + 1)
Next
LineNum = LineNum - 1
Print "Value removed."
Else
Print "Value not found."
End If
Else
Print "No values found."
End If
Exit Do
Case "Q"
Print "Q"
Print "Write recent.bin(y/n)? ";
Do
_Limit 100
Write$ = InKey$
If Len(Write$) Then
Print
Write$ = UCase$(Write$)
Exit Do
End If
Loop
If Write$ = "Y" Then
If LineNum = 0 Then
Print "No values written."
Else
Close
Open File$ For Output As #1
For Linen = 1 To LineNum
Print #1, ""
Print #1, RecentList(Linen)
Next
Print "Recent.bin written."
End If
End If
Color 7
End
End Select
End If
Loop
Loop
End