I am sure full screen editors have been around for awhile but here is another one:
Erik.
Version history:
Code: (Select All)
Initial port to QB64 v1.0a
New v2.0a:
Adds insert cursor for overstrike in Backspace, Tab, and InsertChar.
Adds support for 40 column editing and display.
New v3.0a:
Adds ListFiles and SearchFiles.
New v3.1a:
Fixes some scrolling in SearchFiles.
New v3.2a:
Adds Ctrl-C copyfile in SearchFiles.
Adds Ctrl-D changedrive in SearchFiles.
Adds OldSkool directory delete in SearchFiles.
New v3.3a:
Adds F1 help key to ScrnEdit.
Adds F1 help key to SearchFiles.
New v3.4a:
Adds _hide to shell in SearchFiles.
Adds drives to file list in SearchFiles.
Adds shell to vol to SearchFiles.
New v3.5a:
Moves F2 display in SearchFiles.
Adds F4 toggle sort order in SearchFiles.
Display Drive: and Dir: and File: in Display.Screen in SearchFiles.
New v3.6a:
Adds DriveList to improve display in Display.Screen in SearchFiles.
Adds custom FileExists and DirExists functions.
Adds Ctrl-E MKdir and Ctrl-F refresh to SearchFiles.
New v3.7a:
Adds buffer to Ctrl-C CopyFile in SearchFiles to improve copying speed.
Adds F8 to recursively load file in ScrnEdit.
New v3.8a:
Fixes buffer overrun in CopyFile in SearchFiles.
Fixes pagedown in Ctrl-End in SearchFiles.
Fixes error with long filename.
New v4.0a:
Adds Ctrl-G RenameFile in SearchFiles.
Adds Ambig$ function to ValidFileChar2$
Adds file exists ValidFileChar3$ function to ScrnEdit.
New v4.1a:
Adds Tab and Shift-Tab to SearchFiles.
Adds Control-Right and Control-Left to SearchFiles.
Adds Control-Up and Control-Down to SearchFiles.
Checks Ctrl-D ChangeDrive is in drivelist.
New v4.2a:
Adds F4 AppendFile and F5 InsertFile to ScrnEdit.
Fixes array error in InsertFile.
Adds '-/+', 'a-z', 'A-Z', '0-9' to scan filename in SearchFiles.
Adds F3 to search filename in SearchFile. And Ctrl-F3 to repeat search.
New v4.3a:
Adds counters and continuous display to ListFiles.
Adds FormatString$ output display to ListFiles.
New v4.4a:
Adds prompt for DirSpec in SearchFiles.
Adds F4 to sort files and F5 to sort dirs in SearchFiles.
Adds F6 to recursively call SearchFiles.
I'm surely missing something somewhere but why aren't the subroutines working on the values in this user defined type?
Shouldn't incr be increasing the values as it does for the variable A?
Code: (Select All)
Type score_type
max As Integer
cur As Integer
End Type
Type player_type
power As score_type
speed As score_type
x As Integer
y As Integer
End Type
Is there a simple means to detect the screen mode being used in a program. I can make my program behave so this is not an issue but I want to make it part of a subroutine I may share with others and just not sure how to do it from within the subroutine alone.
Over the past year you've probably noticed that new versions of PE, bug fixes, and enhancements are handled very quickly and efficiently by the PE dev team.
All of this excellent service by them, in my opinion, needs some recognition.
Consider becoming a patron of the site. A few bucks a month goes a long way to help paying the bills. With any extra money left over I would love for these guys to be able to treat themselves and loved ones to a steak dinner now and then.
I recently posted a question about grabbing a url and wrote the following:
This attempts to grab a url and writes it to a filename:
Code: (Select All)
Rem program to grab url filename.
DefLng A-Z
On Error GoTo Hell
$Unstable:Http
Print "Enter url";: Input url$
Print "Enter filename";: Input Urlfile$
If Len(url$) And Len(Urlfile$) Then
Z = DownloadToFileX&(url$, Urlfile$)
If Z = 404 Then
Print "File not found."
Else
If Z >= 200 And Z < 300 Then
Print "Download success."
Else
Print "Download failure."
End If
End If
End If
End
Hell:
Z = 404
Resume Next
' get a file from url and download
Function DownloadToFileX& (url As String, Urlfile$)
Dim bytescopied As Double
Dim bytestring As String
Dim clienthandle As Long
Dim filehandle As Long
client$ = url
If Left$(client$, 2) = "//" Then
client$ = "HTTP:" + client$
End If
If Left$(LCase$(client$), 5) = "http:" Or Left$(LCase$(client$), 6) = "https:" Then
eat$ = ""
Else
client$ = "HTTP:" + client$
End If
' check url exists.
clienthandle = _OpenClient(client$)
If clienthandle = 0 Then
DownloadToFileX& = 404
Print "Cannot open client."
Exit Function
End If
If clienthandle Then
x = _StatusCode(clienthandle)
DownloadToFileX& = x
If x >= 200 And x < 300 Then
' prompt to delete output file only if url exists.
If _FileExists(Urlfile$) Then
Print "Output file exists."
Print "Delete file(y/n/q)?";
Do
_Limit 50
X$ = InKey$
If LCase$(X$) = "y" Then
Var$ = Urlfile$ + Chr$(0)
Kill Var$
Exit Do
End If
If LCase$(X$) = "n" Then
Exit Do
End If
If LCase$(X$) = "q" Then
Close #clienthandle
DownloadToFileX& = 404
Exit Function
End If
Loop
End If
' open output file only if url exists.
filehandle = FreeFile
Open Urlfile$ For Binary As #filehandle
' copy the file.
bytescopied = 0#
starttimer = Timer
While Not EOF(clienthandle)
_Limit 60
Get #clienthandle, , bytestring
Put #filehandle, , bytestring
bytescopied = bytescopied + Len(bytestring)
elapsed = Timer - starttimer
If elapsed < 0 Then elapsed = elapsed + 86400
If elapsed >= 1 Then
starttimer = Timer
_Title "QB64 - Url: " + Str$(bytescopied) + " bytes copied."
End If
Wend
Print "QB64 - Url: " + Str$(bytescopied) + " bytes copied."
Else
Print "Cannot open client."
End If
End If
Close #clienthandle, filehandle
End Function
I have had this issue with QB64 for years, but have just finally decided to bring up the issue.
Here is where the issue happens: I have a hardware point-to-point VPN between work and home. I have a share set up on the server which we will call drive z: I am running QB64 locally on my c: drive. I open a .BAS file from drive z:, make some changes, and save it. This is where the issue happens. It takes FOREVER to save. I just saved a program with 11,912 lines and it took just under 9 minutes for it to save. Of course smaller programs take less time, but even they take a lot of time.
The VPN works great - there are no speed issues here. I ran tests and have no issues. Backups with large amounts of data run across the VPN late every night without issue. If I copy the same .BAS file it completes this operation in less than 1 second regardless of direction (work>home vs. home>work) - there is something about when QB64's IDE writes the .BAS file that is causing this issue.
It is not the antivirus causing the issue either as I have tried this with the AV disabled and had the same result.
I am assuming that the system that the IDE uses to save is creating some kind of bottleneck here? Does the save routine write and close repeatedly? I am grabbing at straws here.
This is not a big issue since I know to avoid it so if I must work on a file locally, I will copy it, work on it, and then send it back rather than try to save across the VPN.
KUB.bas program works if a b c is successfully selected
Does anyone have any experience in creating a parametric ASCII cube?
Code: (Select All)
a = 7: b = 5: c = 8 ' KUB.bas
For i = 1 To c: Print "*";: Next
Print "x";: For i = 1 To a - 2: Print "=";: Next: Print "x 1"
For i = 1 To c - 0 - b:
For j = c - i To 1 Step -1: Print ".";: Next:
Print "/";: For k = 1 To a - 2: Print "-";: Next: Print "/";
For n = 1 To i - 1: Print "o";: Next: Print "| 2"
Next
For j = c - i To 1 Step -1: Print ".";: Next:
Print "/";: For k = 1 To a - 2: Print "-";: Next: Print "/";
For n = 1 To i - 1: Print "o";: Next: Print "x 3"
For m = i To 2 Step -1
For j = m - 1 To 1 Step -1: Print ".";: Next:
Print "/";: For k = 1 To a - 2: Print "-";: Next: Print "/";
For n = 1 To i - 1: Print "o";: Next: Print "/ 4"
Next
Print "x";: For i = 1 To a - 2: Print "=";: Next: Print "x";
For n = 1 To i - 3: Print "o";: Next: Print "/ 5"
For p = 1 To b - 2: Print "|";
For k = 1 To a - 2: Print "-";: Next: Print "|";
For n = 1 To b - p - 2: Print "o";: Next: Print "/ 6"
Next
Print "x";: For i = 1 To a - 2: Print "=";: Next: Print "x 7"
Variant to shift diagonally from top right to left down
in cycle has not yet been developed
and there are apparently 3 layers of cycles
and possibly a shift to right down