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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 111
» Latest member: Ganeshan Kalmane
» Forum threads: 76
» Forum posts: 534

Full Statistics

Latest Threads
The Future
Forum: Suggestions and discussion about PUMP
Last Post: Dale Yarker
4 hours ago
» Replies: 39
» Views: 2,333
DOCX and XLSX Viewer
Forum: PowerBASIC for Windows
Last Post: Gary Beene
4 hours ago
» Replies: 3
» Views: 74
gbScroller - Vertical to ...
Forum: PowerBASIC for Windows
Last Post: Gary Beene
Yesterday, 10:48 PM
» Replies: 1
» Views: 70
Comments re High resoluti...
Forum: Programming
Last Post: David Roberts
09-14-2025, 05:34 PM
» Replies: 12
» Views: 433
High resolution replaceme...
Forum: Source Code Library
Last Post: David Roberts
09-14-2025, 08:11 AM
» Replies: 2
» Views: 289
Pac-Man maze
Forum: Programming
Last Post: Brian Alvarez
09-08-2025, 06:31 PM
» Replies: 11
» Views: 919
gbLocator (Discussion)
Forum: PowerBASIC for Windows
Last Post: Mike Doty
09-07-2025, 12:50 PM
» Replies: 2
» Views: 240
New Announcements?
Forum: Suggestions and discussion about PUMP
Last Post: Stuart McLachlan
09-06-2025, 03:43 AM
» Replies: 0
» Views: 173
WMIC removed in WIn11 25H...
Forum: Programming
Last Post: Stuart McLachlan
09-06-2025, 03:23 AM
» Replies: 0
» Views: 101
Promoting PowerBASIC docu...
Forum: PowerBASIC Documentation
Last Post: Graham McPhee
09-05-2025, 09:46 PM
» Replies: 4
» Views: 1,878

 
  The Future
Posted by: George Bleck - 09-03-2025, 06:28 PM - Forum: Suggestions and discussion about PUMP - Replies (39)

I'd like to start by thanking Albert for hosting our community's new home. This platform has been crucial in bringing our group together and facilitating knowledge-sharing, which would be difficult to achieve without it.

That being said, I think we're still vulnerable to disruptions if something happens to Albert or the current setup. To address this, I propose that we establish a committee to oversee the creation of a more permanent and stable home for our community. This would involve securing reliable hosting, maintenance, and data management, including the ability to export our databases if needed.

To ensure the committee represents our diverse international community, I suggest we aim for broad representation of at least 3-5 members. I know we could nominate some individuals who have demonstrated long-term commitment, but it's essential that potential committee members volunteer and are voted in to confirm their willingness and community acceptance to take on this responsibility.

I'm personally willing to contribute financially to partially support a hosted platform managed by an elected committee, even if I'm not part of the committee myself. I could (and should) not do it alone though, so I expect other donations to help meet the appropriate level of support we would look to achieve.

Establishing bylaws, rules, and other governing documents would be an important next step, which I believe the committee should handle once it's formed.

Thoughts on this proposal?

Print this item

Photo gbLocator
Posted by: Gary Beene - 09-03-2025, 06:28 AM - Forum: Source Code Library - Replies (4)

Howdy!

I've continued working on gbLocator, which provides a user interface to Everything for blind and low vision users.  I'm up to v4.2.

Web Site: https://newvisionconcepts.com/gblocator/gblocator.htm
Installation File:   https://garybeene.com/files/gblocator_setup.exe
Source Code File:   https://garybeene.com/files/gblocator.zip

You'll recall that I spoke with David (Everything author) and he encouraged me to post something on his forum. I've just done that and hope to get some feedback from folks on his forum.

Here are gbLocator images - one with the toolbar showing (low vision users) and one with the toolbar hidden (blind users).

   

... does this forum allow inline images or just thumbnails that are links to the full size image?

Print this item

  gbThreads
Posted by: Gary Beene - 09-03-2025, 02:01 AM - Forum: PowerBASIC for Windows - Replies (14)

With the guidance from the other thread on accessing the forum, I was able to update my gbThreads files through today.

These links contain just the file bigthread.htm. Use it to replace the one you already have.

https://garybeene.com/files/bigthread.zip   140MB

https://garybeene.com/files/bigthread.7z   90MB

I had to manually walk through the forums to get a list of threads that have changed since the last update so please let me know if I missed anything!

Print this item

  High resolution replacement for Sleep
Posted by: David Roberts - 09-01-2025, 10:33 PM - Forum: Source Code Library - Replies (2)

SleepX()

SleepX() is a high resolution replacement for Sleep.

The principle used has an analogy with HiFi were a class B amplifier is used to get us within a neighbourhood of a desired voltage and then uses a class A amplifier to fine tune. The cost of this approach is much less than using only a class A amplifier, which are expensive.

The class B amplifier analogy uses Sleep and the class A amplifier analogy uses the Performance Counter, which has a resolution of 100ns with Windows 10 and later.

The following code has the SleepX() code and a usage example.

This is a typical output.

Code:
Quarter of a millisecond: .2503 ms

2 seconds: 2.0000003 s

Silly: 1234.0003 ms

1  1.0001 ms
2  2.0001 ms
3  3.0002 ms
4  4.0001 ms
5  5.0002 ms
6  6.0002 ms
7  7.0002 ms
8  8.0001 ms
9  9.0001 ms
10  10 ms
11  11.0002 ms
12  12.0002 ms
13  13.0001 ms
14  14.0001 ms
15  15.0001 ms
16  16.0002 ms
17  17.0002 ms
18  18.0002 ms
19  19.0002 ms
20  20.0001 ms
21  21.0003 ms
22  22.0002 ms
23  23.0001 ms
24  24.0001 ms
25  25 ms
26  26.0002 ms
27  27.0002 ms
28  28.0002 ms
29  29.0002 ms
30  30.0002 ms

The first example looks at a delay of a quarter of a millisecond. I doubt that anyone will have a use for that. The second example looks at a delay of two seconds. The third example looks at a 'silly' delay of 1234ms, The following looks at delays from 1ms to 30ms in steps of 1ms.

All the results have a sub micro accuracy inline with the Performance Counter on Windows 10 and later.

SleepX() has two parts: The first part is used for delays <= to 3ms and only polls the Performance Counter. This is expensive but is a short-lived expense and should not impact on the system performance. The second part uses the construct 'Sleep ( n-3 )' to get us within a neighbourhood of the target delay, and then we poll the Performance Counter to fine tune. 'Sleep ( n-3 )' needs a resolution of 1ms and why we use SetHiRes.

'Sleep ( n-3 )' does not use any CPU load. The CPU load only kicks in when we enter the 'class A' mode, so is an absolute value and should not impact on the system performance.

Why was 'n <= 3'.  It is reasonable to expect a 1ms resolution to give a delay of between n ms and n+1 ms. In practice, we can exceed n+1 ms and about one third of delays do just that. It is very rare, but values approaching n+1.5 ms have been seen. To mitigate that issue, 'n <= 3' was chosen.

That is it: A very simple idea to give a high resolution replacement for Sleep with a negligible CPU load.

It is worth noting that
Code:
SetHiRes
<Code to time>
RevokeHiRes
is acceptable, but it should not be used within a loop; for example a graphics application with 60, or so, fps. That will upset the system clock. It is better to use SetHiRes at the beginning of an application and RevokeHiRes when the higher resolution is no longer needed. If you forget to use RevokeHiRes SetHiRes will be cancelled when the process terminates. Microsoft neglects to mention that.

Code:
#COMPILE EXE
#DIM ALL
#INCLUDE "win32api.inc"

' SOURCE CODE:

Macro QPC = QueryPerformanceCounter qTimeNow

Macro SetHiRes
  MacroTemp Time
  Dim Time As TIMECAPS
  TimeGetDevCaps( Time, SizeOf(Time) )
  TimeBeginPeriod(Time.wPeriodMin)
  'Sleep 16 ' Pre Windows 10 - high resolution does not 'byte' until next clock tick.
End Macro

Macro RevokeHiRes
  MacroTemp Time
  Dim Time As TIMECAPS
  TimeGetDevCaps( Time, SizeOf(Time) )
  TimeEndPeriod(Time.wPeriodMin)
End Macro

Global qFreq As Quad

Sub SleepX( ByVal n As Double )
  Local qTarget, qTimeNow As Quad
  QPC
  qTarget = qTimeNow + n*qFreq*0.001
  If n <= 3 then
    Do : QPC : Loop Until qTimeNow >= qTarget ' Class A amplifier analogy
  Else
    ' Class B amplifier analogy followed by Classs A amplifier analogy
    Sleep ( n-3 ) : Do : QPC : Loop Until qTimeNow >= qTarget
  End If
End Sub

' ====================

' EXAMPLE USAGE:

Function Pbmain () As Long
Local i as Long
Local qStart, qStop As Quad

  QueryPerformanceFrequency qFreq

  SetHiRes

  QueryPerformanceCounter qStart
    SleepX(0.25)
  QueryPerformanceCounter qStop
  Print "Quarter of a millisecond:";(qStop - qStart)*1000/qFreq;"ms"
  Print

  QueryPerformanceCounter qStart
    SleepX(2000)
  QueryPerformanceCounter qStop
  Print "2 seconds:";(qStop - qStart)/qFreq;"s"
  Print

  QueryPerformanceCounter qStart
    SleepX(1234)
  QueryPerformanceCounter qStop
  Print "Silly:";(qStop - qStart)*1000/qFreq;"ms"
  Print

  For i = 1 to 30
    QueryPerformanceCounter qStart
      SleepX(i)
    QueryPerformanceCounter qStop
    Print i;" ";(qStop - qStart)*1000/qFreq;"ms"
  Next

  RevokeHiRes

  WaitKey$

End Function

Print this item

  If you want to get to the PB Forum, do this
Posted by: Albert Richheimer - 09-01-2025, 04:53 PM - Forum: Suggestions and discussion about PUMP - No Replies

I have moved Carlo's thread into the members area, in Issues About The PowerBASIC Forum

Should be a better solution, so that the new PB owners won't be aware that we still have access to forum.powerbasic.com.

Print this item

  Clockwise sort of coordinates
Posted by: Torkel M. Jodalen - 08-30-2025, 09:33 AM - Forum: Programming - Replies (3)

Anyone who cares to post the final iteration of the "clockwise sort of coordinates" source code, which was recently discussed in the PB forums? I waited too long to store a local copy.

Thanks.

Print this item

  Pac-Man maze
Posted by: Jules Marchildon - 08-30-2025, 03:28 AM - Forum: Programming - Replies (11)

I'm starting to work on a pac-man maze.  I have a long road ahead of me with this challenge.   I'm going with a technique I read up on using tiles that are setup as a grid that allows you to draw the maze dynamically.  Each tile is stored in a 2D array.  The maze is setup 28 across and 31 tiles down.  The array elements are structures that allow you to include properties or attributes about the tile and can be used for game flow logic and drawing updates.   I'm curious to know if anyone else in PB land has done any work in this area?  TIA. 

A picture of what I have so far... (obviously more work to be done )
   

Print this item

  Hardware via USB
Posted by: Tillmann Viefhaus - 07-05-2025, 06:52 AM - Forum: Special Interest Groups - Replies (2)

How could I detect and handle for example a webcam with Power Basic?
I have no experience with this topic.

Print this item

  The FILECOPY command
Posted by: Tillmann Viefhaus - 06-15-2025, 05:04 PM - Forum: PowerBASIC for Windows - Replies (4)

When I write:

CHDR "D:\Test_with_Files"

A = "Original.exe"
B = "Original_Copy.exe"
Filecopy A, B

A is existing on the harddrive but File B is not created. Why is that?

Print this item

  Getting Current UTC
Posted by: Owen_English - 05-30-2025, 06:22 AM - Forum: PowerBASIC for Windows - Replies (14)

Have waded back thru the previous forum posts but at a loss to get an answer.
Sorry if it's been asked before but all I need is the numerical string for the Current UTC timestamp.
How?
Thanks.

Print this item