Welcome, Guest
You have to register before you can post on our site.

Username/Email:
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 489
» Latest member: stanforddick
» Forum threads: 2,818
» Forum posts: 26,445

Full Statistics

Latest Threads
Attachment error
Forum: Help Me!
Last Post: eoredson
1 hour ago
» Replies: 3
» Views: 38
1990's 3D Doom-Like Walls...
Forum: Programs
Last Post: SquirrelMonkey
1 hour ago
» Replies: 2
» Views: 6
Reading my brainwaves in ...
Forum: Programs
Last Post: SquirrelMonkey
2 hours ago
» Replies: 0
» Views: 11
Playing sound files in QB...
Forum: Programs
Last Post: hsiangch_ong
2 hours ago
» Replies: 8
» Views: 1,080
Masakari - the abandoned ...
Forum: Programs
Last Post: Sanmayce
5 hours ago
» Replies: 2
» Views: 145
Problem with "MOD"
Forum: General Discussion
Last Post: Pete
6 hours ago
» Replies: 5
» Views: 53
New and improved SICK pro...
Forum: Utilities
Last Post: eoredson
6 hours ago
» Replies: 34
» Views: 3,707
which day of the week
Forum: Programs
Last Post: Pete
7 hours ago
» Replies: 25
» Views: 402
Rock Jockey 2.0 is ready ...
Forum: Games
Last Post: NakedApe
9 hours ago
» Replies: 12
» Views: 342
Audio Spectrum Analyser
Forum: Programs
Last Post: Petr
10 hours ago
» Replies: 2
» Views: 48

 
  Small full screen editor
Posted by: eoredson - 11-11-2023, 08:00 AM - Forum: Utilities - Replies (13)

Hi,

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.



Attached Files
.txt   scrnedit.txt (Size: 907 bytes / Downloads: 35)
.bas   SCRNEDIT.BAS (Size: 118.97 KB / Downloads: 49)
Print this item

  Why aren't these subroutines working on user defined types?
Posted by: James D Jarvis - 11-10-2023, 01:30 AM - Forum: Help Me! - Replies (4)

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

Dim player As player_type

player.power.max = 100
player.power.cur = 0
player.x = 100
player.y = 100

A = 10
incr A, 1
Print A   

incr player.power.cur, 1
Print player.power.cur

incr player.x, 1
Print player.x

Sub incr (n, v)
    n = n + v
End Sub

Sub decr (n, v)
    n = n - v
End Sub

Print this item

  Detect Current Screen Mode?
Posted by: James D Jarvis - 11-07-2023, 10:34 PM - Forum: Help Me! - Replies (2)

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.

Print this item

  Windows Security does not like this example
Posted by: James D Jarvis - 11-07-2023, 10:21 PM - Forum: General Discussion - Replies (4)

Windows security does not like this example:
_MEM - QB64 Phoenix Edition Wiki

It quarantined QB6PE itself.     Likely related to recent scare someone else had.

Print this item

  Consider becoming a patron
Posted by: TerryRitchie - 11-07-2023, 06:49 PM - Forum: General Discussion - Replies (16)

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.

Here is the link to the Patreon discussion: https://qb64phoenix.com/forum/showthread.php?tid=1387

Print this item

  Grab URL from net to file
Posted by: eoredson - 11-07-2023, 07:39 AM - Forum: Programs - Replies (5)

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

Print this item

  File menu recent list
Posted by: eoredson - 11-07-2023, 06:45 AM - Forum: Help Me! - Replies (15)

Hi,

I had an idea that is such::

In Alt-F recent list could you add Delete key to remove an item!?

Erik.

Print this item

  Issue saving across VPN
Posted by: dano - 11-07-2023, 03:08 AM - Forum: General Discussion - Replies (21)

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.

Thanks,
dano

Print this item

  BAM Draw
Posted by: CharlieJV - 11-06-2023, 04:18 AM - Forum: QBJS, BAM, and Other BASICs - Replies (9)

Although I've got some small things left to do along with some code cleanup, this ASCII drawing program seems to be working A-1.

For details: https://basicanywheremachine-news.blogsp...-draw.html

   

Print this item

  ASCII cube
Posted by: DANILIN - 11-05-2023, 06:29 AM - Forum: Programs - Replies (6)

ASCII cube

ASCII theme + cube theme = ASCII cube theme

Given: enter the sides of the cube and build a pseudo 3d

I think 7 layers are possible

Code: (Select All)
'12345678x12345x KUB.bas
'********x=====x 1
'*******/*****/1 2
'******/*****/*2 2
'*****/*****/**3 2
'****/*****/***X 3
'***/*****/***1  4
'**/*****/***2   4
'*/*****/***3    4
'1234567***4     5
'1*****1**5      6
'2*****2*6       6
'3*****37        6
'1234567         7
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"


Code: (Select All)
**********x=====x 1
........./-----/| 2
......../-----/o| 2
......./-----/oo| 2
....../-----/ooo| 2
...../-----/ooox 3
..../-----/ooo/ 4
.../-----/ooo/ 4
../-----/ooo/ 4
./-----/ooo/ 4
x=====xooo/ 5
|-----|oo/ 6
|-----|o/ 6
|-----|/ 6
x=====x 7

https://jdoodle.com/ia/PXs and press Execute

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

Print this item