<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title><![CDATA[PowerBASIC Users Meeting Point - Programming]]></title>
		<link>http://pump.richheimer.de/</link>
		<description><![CDATA[PowerBASIC Users Meeting Point - http://pump.richheimer.de]]></description>
		<pubDate>Fri, 01 May 2026 03:52:45 +0000</pubDate>
		<generator>MyBB</generator>
		<item>
			<title><![CDATA[Very Simple Round Gauge Discussion Thread]]></title>
			<link>http://pump.richheimer.de/showthread.php?tid=85</link>
			<pubDate>Wed, 24 Sep 2025 21:33:01 +0000</pubDate>
			<dc:creator><![CDATA[<a href="http://pump.richheimer.de/member.php?action=profile&uid=11">Jules Marchildon</a>]]></dc:creator>
			<guid isPermaLink="false">http://pump.richheimer.de/showthread.php?tid=85</guid>
			<description><![CDATA[<a href="http://pump.richheimer.de/showthread.php?tid=84&amp;pid=603#pid603" target="_blank" rel="noopener" class="mycode_url">Posted</a>  in source code forum.<br />
<br />
Nice one Kevin,  yours looks better.   I didn't know I had a friendly stalker!  <img src="http://pump.richheimer.de/images/smilies/biggrin.png" alt="Big Grin" title="Big Grin" class="smilie smilie_4" /><br />
<br />
Patrice, I gave it a try,  while I've run out of socks from trying all your other demo's out, I did feel the whoosh and then  goosebumps!  Impressive!  Seems much much faster!   Did you use the native LZNT1 in the last release?<br />
<br />
Since I know diddly about obj files I downloaded a free one of the curiosity Rover...<br />
<a href="https://free3d.com/3d-model/curiosity-rover-46907.html" target="_blank" rel="noopener" class="mycode_url">https://free3d.com/3d-model/curiosity-rover-46907.html</a><br />
...but it's missing the MTL file, so I made one up, unfortunately the conversion still failed.   <br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code># dummy MTL for Curiosity Rover<br />
newmtl default<br />
Ka 0.200000 0.200000 0.200000<br />
Kd 0.666667 0.666667 0.666667<br />
Ks 0.000000 0.000000 0.000000<br />
Ns 1.000000<br />
illum 2</code></div></div><span style="font-size: 1pt;" class="mycode_size"><span style="font-family: Monaco, Consolas, Courier, monospace;" class="mycode_font">Pl</span></span><br />
<span style="font-size: 1pt;" class="mycode_size"><span style="font-family: Monaco, Consolas, Courier, monospace;" class="mycode_font">P</span></span>]]></description>
			<content:encoded><![CDATA[<a href="http://pump.richheimer.de/showthread.php?tid=84&amp;pid=603#pid603" target="_blank" rel="noopener" class="mycode_url">Posted</a>  in source code forum.<br />
<br />
Nice one Kevin,  yours looks better.   I didn't know I had a friendly stalker!  <img src="http://pump.richheimer.de/images/smilies/biggrin.png" alt="Big Grin" title="Big Grin" class="smilie smilie_4" /><br />
<br />
Patrice, I gave it a try,  while I've run out of socks from trying all your other demo's out, I did feel the whoosh and then  goosebumps!  Impressive!  Seems much much faster!   Did you use the native LZNT1 in the last release?<br />
<br />
Since I know diddly about obj files I downloaded a free one of the curiosity Rover...<br />
<a href="https://free3d.com/3d-model/curiosity-rover-46907.html" target="_blank" rel="noopener" class="mycode_url">https://free3d.com/3d-model/curiosity-rover-46907.html</a><br />
...but it's missing the MTL file, so I made one up, unfortunately the conversion still failed.   <br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code># dummy MTL for Curiosity Rover<br />
newmtl default<br />
Ka 0.200000 0.200000 0.200000<br />
Kd 0.666667 0.666667 0.666667<br />
Ks 0.000000 0.000000 0.000000<br />
Ns 1.000000<br />
illum 2</code></div></div><span style="font-size: 1pt;" class="mycode_size"><span style="font-family: Monaco, Consolas, Courier, monospace;" class="mycode_font">Pl</span></span><br />
<span style="font-size: 1pt;" class="mycode_size"><span style="font-family: Monaco, Consolas, Courier, monospace;" class="mycode_font">P</span></span>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[WAITKEY$ not in FreeBASIC]]></title>
			<link>http://pump.richheimer.de/showthread.php?tid=83</link>
			<pubDate>Tue, 23 Sep 2025 12:03:46 +0000</pubDate>
			<dc:creator><![CDATA[<a href="http://pump.richheimer.de/member.php?action=profile&uid=23">Dale Yarker</a>]]></dc:creator>
			<guid isPermaLink="false">http://pump.richheimer.de/showthread.php?tid=83</guid>
			<description><![CDATA[not posted in FreeBASIC forum because a PB user will know what I'm talking about.<br />
<br />
I'm having bad success compiling and running (from tiko).<br />
<br />
(before someone bitches - isn't helping coders only used to PB a good subject for PUMP?<br />
<br />
One problem is the FreeBASIC "appears" not to run because console never shows. They do run from Command Prompt because console does not close at end of code. I can not find an equivalent to WAITKEY&#36; in FreeBASIC. The problem presents with samples from FreeBASIC and tiko too. FreeBASIC INKEY in a loop should work. Is that the answer?<br />
<br />
GUI sample problems later.<br />
<br />
(repeat from elsewhere- I'm not really transitioning from PB to FreeBASIC. It is a 64 bit alternative even though what I do does not need that much horsepower)<br />
<br />
Cheers,]]></description>
			<content:encoded><![CDATA[not posted in FreeBASIC forum because a PB user will know what I'm talking about.<br />
<br />
I'm having bad success compiling and running (from tiko).<br />
<br />
(before someone bitches - isn't helping coders only used to PB a good subject for PUMP?<br />
<br />
One problem is the FreeBASIC "appears" not to run because console never shows. They do run from Command Prompt because console does not close at end of code. I can not find an equivalent to WAITKEY&#36; in FreeBASIC. The problem presents with samples from FreeBASIC and tiko too. FreeBASIC INKEY in a loop should work. Is that the answer?<br />
<br />
GUI sample problems later.<br />
<br />
(repeat from elsewhere- I'm not really transitioning from PB to FreeBASIC. It is a 64 bit alternative even though what I do does not need that much horsepower)<br />
<br />
Cheers,]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Comments re High resolution replacement for Sleep]]></title>
			<link>http://pump.richheimer.de/showthread.php?tid=74</link>
			<pubDate>Sat, 13 Sep 2025 23:00:49 +0000</pubDate>
			<dc:creator><![CDATA[<a href="http://pump.richheimer.de/member.php?action=profile&uid=10">David Roberts</a>]]></dc:creator>
			<guid isPermaLink="false">http://pump.richheimer.de/showthread.php?tid=74</guid>
			<description><![CDATA[I had a bit of a 'carrry on' creating post #2. I couldn't figure out the difference between 'Quick Edit' and 'Full Edit'. On one occasion, I got post #1 merging with post #2. On another occasion, I got post #2 being duplicated within itself.<br />
<br />
Would someone explain the difference?<br />
<br />
Anyway, the question is whether to use SleepX or SleepXX. I cannot answer that - only you can by trying the two source codes. On my Windows 10 machine with a Performance Counter Frequency of 10MHz and a CPU Base Frequency of 3.5GHz SleepXX is the more accurate.<br />
<br />
If you have the time, would you let me know what your Performance Counter Frequency is, your CPU Base Frequency, and a console output of the more accurate.<br />
<br />
Ta much.  <img src="http://pump.richheimer.de/images/smilies/smile.png" alt="Smile" title="Smile" class="smilie smilie_1" />]]></description>
			<content:encoded><![CDATA[I had a bit of a 'carrry on' creating post #2. I couldn't figure out the difference between 'Quick Edit' and 'Full Edit'. On one occasion, I got post #1 merging with post #2. On another occasion, I got post #2 being duplicated within itself.<br />
<br />
Would someone explain the difference?<br />
<br />
Anyway, the question is whether to use SleepX or SleepXX. I cannot answer that - only you can by trying the two source codes. On my Windows 10 machine with a Performance Counter Frequency of 10MHz and a CPU Base Frequency of 3.5GHz SleepXX is the more accurate.<br />
<br />
If you have the time, would you let me know what your Performance Counter Frequency is, your CPU Base Frequency, and a console output of the more accurate.<br />
<br />
Ta much.  <img src="http://pump.richheimer.de/images/smilies/smile.png" alt="Smile" title="Smile" class="smilie smilie_1" />]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[WMIC removed in WIn11 25H2]]></title>
			<link>http://pump.richheimer.de/showthread.php?tid=67</link>
			<pubDate>Sat, 06 Sep 2025 02:23:36 +0000</pubDate>
			<dc:creator><![CDATA[<a href="http://pump.richheimer.de/member.php?action=profile&uid=33">Stuart McLachlan</a>]]></dc:creator>
			<guid isPermaLink="false">http://pump.richheimer.de/showthread.php?tid=67</guid>
			<description><![CDATA[There are currently a number of threads in gbThreads that contain a Shell to WMIC  (Windows Management Instrumentation Command-line), including some from the last few years.  <br />
<br />
If you are currently using an application that Shells to WMIC, it will not work in Win11 25H2 (coming very soon).  It is being removed (along with PowerShell 2.0).]]></description>
			<content:encoded><![CDATA[There are currently a number of threads in gbThreads that contain a Shell to WMIC  (Windows Management Instrumentation Command-line), including some from the last few years.  <br />
<br />
If you are currently using an application that Shells to WMIC, it will not work in Win11 25H2 (coming very soon).  It is being removed (along with PowerShell 2.0).]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Very Fast WString /Object Hash Table (Comments)]]></title>
			<link>http://pump.richheimer.de/showthread.php?tid=66</link>
			<pubDate>Fri, 05 Sep 2025 01:20:41 +0000</pubDate>
			<dc:creator><![CDATA[<a href="http://pump.richheimer.de/member.php?action=profile&uid=164">Stanley Durham</a>]]></dc:creator>
			<guid isPermaLink="false">http://pump.richheimer.de/showthread.php?tid=66</guid>
			<description><![CDATA[One thing I learned from this, for absolute speed, you can’t use normal WString comparison. Also, Equal is faster than Comparison if that’s all you need, which is the case with a hash table. Comparison requires two comparisons to determine if it’s less than or greater than. For absolute speed, you can’t use; If A&#36; = B&#36; Then.<br />
In the Equal callback, testing the lengths first immediately eliminates some values. Passing a pointer and the length to the callback eliminates that overhead in the callback.<br />
I could get this faster, about 0.095 seconds to find 1,000,000 keys, by writing the code inline instead of using callbacks, but the complexity isn’t worth the benefit.<br />
<hr class="mycode_hr" />
Code:<br />
<a href="http://pump.richheimer.de/showthread.php?tid=65" target="_blank" rel="noopener" class="mycode_url">Very Fast WString /Object Hash Table</a>]]></description>
			<content:encoded><![CDATA[One thing I learned from this, for absolute speed, you can’t use normal WString comparison. Also, Equal is faster than Comparison if that’s all you need, which is the case with a hash table. Comparison requires two comparisons to determine if it’s less than or greater than. For absolute speed, you can’t use; If A&#36; = B&#36; Then.<br />
In the Equal callback, testing the lengths first immediately eliminates some values. Passing a pointer and the length to the callback eliminates that overhead in the callback.<br />
I could get this faster, about 0.095 seconds to find 1,000,000 keys, by writing the code inline instead of using callbacks, but the complexity isn’t worth the benefit.<br />
<hr class="mycode_hr" />
Code:<br />
<a href="http://pump.richheimer.de/showthread.php?tid=65" target="_blank" rel="noopener" class="mycode_url">Very Fast WString /Object Hash Table</a>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Clockwise sort of coordinates]]></title>
			<link>http://pump.richheimer.de/showthread.php?tid=56</link>
			<pubDate>Sat, 30 Aug 2025 08:33:46 +0000</pubDate>
			<dc:creator><![CDATA[<a href="http://pump.richheimer.de/member.php?action=profile&uid=15">Torkel M. Jodalen</a>]]></dc:creator>
			<guid isPermaLink="false">http://pump.richheimer.de/showthread.php?tid=56</guid>
			<description><![CDATA[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.<br />
<br />
Thanks.]]></description>
			<content:encoded><![CDATA[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.<br />
<br />
Thanks.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Pac-Man maze]]></title>
			<link>http://pump.richheimer.de/showthread.php?tid=55</link>
			<pubDate>Sat, 30 Aug 2025 02:28:29 +0000</pubDate>
			<dc:creator><![CDATA[<a href="http://pump.richheimer.de/member.php?action=profile&uid=11">Jules Marchildon</a>]]></dc:creator>
			<guid isPermaLink="false">http://pump.richheimer.de/showthread.php?tid=55</guid>
			<description><![CDATA[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. <br />
<br />
A picture of what I have so far... (obviously more work to be done )<br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="http://pump.richheimer.de/images/attachtypes/image.png" title="JPG Image" border="0" alt=".jpg" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=32" target="_blank" title="">sofar.jpg</a> (Size: 82.42 KB / Downloads: 32)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[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. <br />
<br />
A picture of what I have so far... (obviously more work to be done )<br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="http://pump.richheimer.de/images/attachtypes/image.png" title="JPG Image" border="0" alt=".jpg" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=32" target="_blank" title="">sofar.jpg</a> (Size: 82.42 KB / Downloads: 32)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[The LeapYear]]></title>
			<link>http://pump.richheimer.de/showthread.php?tid=47</link>
			<pubDate>Fri, 07 Mar 2025 15:09:06 +0000</pubDate>
			<dc:creator><![CDATA[<a href="http://pump.richheimer.de/member.php?action=profile&uid=140">Andy Dee</a>]]></dc:creator>
			<guid isPermaLink="false">http://pump.richheimer.de/showthread.php?tid=47</guid>
			<description><![CDATA[<a href="http://pump.richheimer.de/showthread.php?tid=10" target="_blank" rel="noopener" class="mycode_url">Here</a>, Dale Yarker shows a fast Way to find a Leap Year.<br />
<br />
This looks very nice - for 32-Bit Systems.<br />
<br />
Programming in 16-Bit PB 3.5  for DOS, I can only make  <img src="http://pump.richheimer.de/images/smilies/cry.png" alt="Cry" title="Cry" class="smilie smilie_21" /> eyes…  <img src="http://pump.richheimer.de/images/smilies/huh.png" alt="Huh" title="Huh" class="smilie smilie_17" /><br />
<br />
I use a much slower routine, calculating results for julian and gregorian calendar.<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>Declare _<br />
Function iFeb(ByVal iJahr As Integer)        As Integer<br />
Function iFeb(ByVal iJahr As Integer) Public As Integer<br />
  If iJahr &lt; 1582% then<br />
    Function = 29% _<br />
           &nbsp;&nbsp;+ ( _<br />
               &nbsp;&nbsp;( _<br />
                 &nbsp;&nbsp;iJahr Mod 4% _<br />
               &nbsp;&nbsp;) _<br />
               &nbsp;&nbsp;&lt;&gt; 0% _<br />
             &nbsp;&nbsp;)<br />
  Else<br />
    Function = 29% _<br />
           &nbsp;&nbsp;+ ( _<br />
               &nbsp;&nbsp;( _<br />
                 &nbsp;&nbsp;iJahr/4 _<br />
               &nbsp;&nbsp;) _<br />
               &nbsp;&nbsp;&lt;&gt; _<br />
               &nbsp;&nbsp;( _<br />
                 &nbsp;&nbsp;iJahr&#92;4 _<br />
               &nbsp;&nbsp;) _<br />
               &nbsp;&nbsp;Or _<br />
               &nbsp;&nbsp;( _<br />
                 &nbsp;&nbsp;iJahr/100 _<br />
               &nbsp;&nbsp;) _<br />
               &nbsp;&nbsp;= _<br />
               &nbsp;&nbsp;( _<br />
                 &nbsp;&nbsp;iJahr&#92;100 _<br />
               &nbsp;&nbsp;) _<br />
               &nbsp;&nbsp;And _<br />
               &nbsp;&nbsp;( _<br />
                 &nbsp;&nbsp;iJahr/400 _<br />
               &nbsp;&nbsp;) _<br />
               &nbsp;&nbsp;&lt;&gt; _<br />
               &nbsp;&nbsp;( _<br />
                 &nbsp;&nbsp;iJahr&#92;400 _<br />
               &nbsp;&nbsp;) _<br />
             &nbsp;&nbsp;)<br />
  End If<br />
End Function</code></div></div><br />
Does someone has an idea, how this could look in 16-Bit-Inline-Asm?]]></description>
			<content:encoded><![CDATA[<a href="http://pump.richheimer.de/showthread.php?tid=10" target="_blank" rel="noopener" class="mycode_url">Here</a>, Dale Yarker shows a fast Way to find a Leap Year.<br />
<br />
This looks very nice - for 32-Bit Systems.<br />
<br />
Programming in 16-Bit PB 3.5  for DOS, I can only make  <img src="http://pump.richheimer.de/images/smilies/cry.png" alt="Cry" title="Cry" class="smilie smilie_21" /> eyes…  <img src="http://pump.richheimer.de/images/smilies/huh.png" alt="Huh" title="Huh" class="smilie smilie_17" /><br />
<br />
I use a much slower routine, calculating results for julian and gregorian calendar.<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>Declare _<br />
Function iFeb(ByVal iJahr As Integer)        As Integer<br />
Function iFeb(ByVal iJahr As Integer) Public As Integer<br />
  If iJahr &lt; 1582% then<br />
    Function = 29% _<br />
           &nbsp;&nbsp;+ ( _<br />
               &nbsp;&nbsp;( _<br />
                 &nbsp;&nbsp;iJahr Mod 4% _<br />
               &nbsp;&nbsp;) _<br />
               &nbsp;&nbsp;&lt;&gt; 0% _<br />
             &nbsp;&nbsp;)<br />
  Else<br />
    Function = 29% _<br />
           &nbsp;&nbsp;+ ( _<br />
               &nbsp;&nbsp;( _<br />
                 &nbsp;&nbsp;iJahr/4 _<br />
               &nbsp;&nbsp;) _<br />
               &nbsp;&nbsp;&lt;&gt; _<br />
               &nbsp;&nbsp;( _<br />
                 &nbsp;&nbsp;iJahr&#92;4 _<br />
               &nbsp;&nbsp;) _<br />
               &nbsp;&nbsp;Or _<br />
               &nbsp;&nbsp;( _<br />
                 &nbsp;&nbsp;iJahr/100 _<br />
               &nbsp;&nbsp;) _<br />
               &nbsp;&nbsp;= _<br />
               &nbsp;&nbsp;( _<br />
                 &nbsp;&nbsp;iJahr&#92;100 _<br />
               &nbsp;&nbsp;) _<br />
               &nbsp;&nbsp;And _<br />
               &nbsp;&nbsp;( _<br />
                 &nbsp;&nbsp;iJahr/400 _<br />
               &nbsp;&nbsp;) _<br />
               &nbsp;&nbsp;&lt;&gt; _<br />
               &nbsp;&nbsp;( _<br />
                 &nbsp;&nbsp;iJahr&#92;400 _<br />
               &nbsp;&nbsp;) _<br />
             &nbsp;&nbsp;)<br />
  End If<br />
End Function</code></div></div><br />
Does someone has an idea, how this could look in 16-Bit-Inline-Asm?]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Mapped Drives and Run As Administrator issue]]></title>
			<link>http://pump.richheimer.de/showthread.php?tid=24</link>
			<pubDate>Wed, 29 Jan 2025 01:45:25 +0000</pubDate>
			<dc:creator><![CDATA[<a href="http://pump.richheimer.de/member.php?action=profile&uid=33">Stuart McLachlan</a>]]></dc:creator>
			<guid isPermaLink="false">http://pump.richheimer.de/showthread.php?tid=24</guid>
			<description><![CDATA[Just ran into a little oops.<br />
<br />
Writing a small backup utility to copy files from a mapped drive to a USB Thumb Drive.<br />
I initially couldn't work out why it was silently failing with "Compile and Execute"  <br />
<br />
I tried running the executable from Windows Explorer and it worked.<br />
<br />
Then it dawned on me <img src="http://pump.richheimer.de/images/smilies/smile.png" alt="Smile" title="Smile" class="smilie smilie_1" />: <br />
I have PBEdit and PBWin set to "run as Administrator' to avoid the known issues with occasional slow compilation and/or compiler fails.<br />
"Administrator " didn't have the drive mapping.<br />
<br />
My solution:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>      dwDrives = GetLogicalDrives<br />
      IF BIT(dwDrives,25) = 0 THEN ' Drive Z not available<br />
      ? "Cannot access source drive Z:&#92;." &amp; &#36;LF &amp; &#36;LF &amp; "You must run this application as a user with drive Z:&#92; mapped!" &amp; &#36;LF &amp; &#36;LF &amp;  _<br />
        "Note that the backup will fail if you run ""as administrator"" rather than as a normal user who has Z:&#92; mapped",%MB_ICONERROR,"Backup To USB Failed"<br />
      EXIT FUNCTION<br />
  END IF</code></div></div>]]></description>
			<content:encoded><![CDATA[Just ran into a little oops.<br />
<br />
Writing a small backup utility to copy files from a mapped drive to a USB Thumb Drive.<br />
I initially couldn't work out why it was silently failing with "Compile and Execute"  <br />
<br />
I tried running the executable from Windows Explorer and it worked.<br />
<br />
Then it dawned on me <img src="http://pump.richheimer.de/images/smilies/smile.png" alt="Smile" title="Smile" class="smilie smilie_1" />: <br />
I have PBEdit and PBWin set to "run as Administrator' to avoid the known issues with occasional slow compilation and/or compiler fails.<br />
"Administrator " didn't have the drive mapping.<br />
<br />
My solution:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>      dwDrives = GetLogicalDrives<br />
      IF BIT(dwDrives,25) = 0 THEN ' Drive Z not available<br />
      ? "Cannot access source drive Z:&#92;." &amp; &#36;LF &amp; &#36;LF &amp; "You must run this application as a user with drive Z:&#92; mapped!" &amp; &#36;LF &amp; &#36;LF &amp;  _<br />
        "Note that the backup will fail if you run ""as administrator"" rather than as a normal user who has Z:&#92; mapped",%MB_ICONERROR,"Backup To USB Failed"<br />
      EXIT FUNCTION<br />
  END IF</code></div></div>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Calling opcode string discussion]]></title>
			<link>http://pump.richheimer.de/showthread.php?tid=21</link>
			<pubDate>Mon, 27 Jan 2025 19:18:28 +0000</pubDate>
			<dc:creator><![CDATA[<a href="http://pump.richheimer.de/member.php?action=profile&uid=97">Pierre Bellisle</a>]]></dc:creator>
			<guid isPermaLink="false">http://pump.richheimer.de/showthread.php?tid=21</guid>
			<description><![CDATA[<span style="font-weight: bold;" class="mycode_b">Calling opcode string</span> discussion was started at <a href="https://forum.powerbasic.com/forum/user-to-user-discussions/programming/838669-calling-opcode-string-discussion" target="_blank" rel="noopener" class="mycode_url">https://forum.powerbasic.com/forum/user-...discussion</a><br />
<br />
It is an answer To Anne on how to get and embed a function in a string and call it via "call dword"<br />
This one show particularly how to find the end of the function code by inserting data near the end.<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>'follow up of https://forum.powerbasic.com/forum/user-to-user-discussions/programming/838669-calling-opcode-string-discussion<br />
<br />
#compile exe '#Win 10.04 (D:&#92;Dev&#92;Pow&#92;Bas&#92;Jose Roca&#92;Forum&#92;Jose&#92;Windows API Headers&#92;3.1.07&#92;uz)#<br />
#dim all<br />
'#register none<br />
'%Unicode = 1<br />
#include "Win32Api.inc"<br />
<br />
#RESOURCE MANIFEST, 1, "XPTheme.xml"<br />
<br />
global hDlg as dword<br />
<br />
&#36;AppName  = "call dword"<br />
%Static01 = 101<br />
%Button01 = 201<br />
<br />
declare function myfunction(byval var1 as long ,byval var2 as long) as long 'for call dword to use<br />
'_____________________________________________________________________________<br />
<br />
function HexView&#36;(sString as string) as string 'HexString<br />
 local  pByte   as byte pointer<br />
 local  sBuffer as string<br />
 local  sChar16 as string<br />
 local  Looper  as long<br />
<br />
 pByte = strptr(sString)<br />
 do<br />
   if (Looper and 15) = 00 then                 'Like MOD 16<br />
     sBuffer = sBuffer &amp; hex&#36;(Looper, 4) &amp; ": " 'Line number:<br />
   elseif (Looper and 07) = 00 then             'Like MOD 8<br />
     sBuffer = sBuffer &amp; "- "                   'Middle dash<br />
   end if<br />
<br />
   if Looper &lt; len(sString) then                'Add data<br />
     sBuffer = sBuffer &amp; hex&#36;(@pByte[Looper], 2) &amp; &#36;spc<br />
   else<br />
     #if %def(%pb_win32) 'A to F have bigger width<br />
     sBuffer = sBuffer &amp; "     "                'Windows: No more data, fill with five spaces<br />
     #else 'Use STDOUT in console<br />
     sBuffer = sBuffer &amp; "   "                  'Console: No more data, fill with three spaces<br />
     #endif<br />
   end if<br />
<br />
   if (Looper and 15) = 15 then                 'End of 16 bytes line<br />
     sChar16 = mid&#36;(sString, Looper -14, 16) 'Next line replace non visible characters with dot<br />
     replace any chr&#36;(0,1,7,9,10,13,27 to 31,127,129,140,141,143,144,152,157) with "..................." in sChar16<br />
     sBuffer = sBuffer &amp; "; " &amp; sChar16 &amp; &#36;crlf 'Add ascii string and CRLF<br />
     if Looper &gt;= len(sString) - 1 then exit do 'Job done<br />
   end if<br />
<br />
   incr Looper<br />
<br />
 loop<br />
 function = "Binary data lenght is" &amp; str&#36;(len(sString)) &amp; " bytes." &amp; &#36;crlf &amp; sBuffer<br />
<br />
end function<br />
'____________________________________________________________________________<br />
<br />
function Add2Numbers(byval var1 as long ,byval var2 as long) as long<br />
<br />
 function = var1 + var2<br />
 'function = var2<br />
<br />
 exit function<br />
 !DB &amp;h12, &amp;h34, &amp;h56, &amp;h78, &amp;h9A, &amp;hBC, &amp;hDE, &amp;hF0 <br />
<br />
end function<br />
'_____________________________________________________________________________<br />
<br />
callback function DlgProc<br />
 local sAsm        as string<br />
 local sTerminator as string<br />
 local pcode       as dword<br />
 local pString     as dword<br />
 local RetVal      as long<br />
 local byteVal     as byte<br />
<br />
 select case cbmsg<br />
<br />
   case %wm_command<br />
     select case cbctl<br />
<br />
       case %Button01<br />
         if cbctlmsg = %bn_clicked or cbctlmsg = 1 then<br />
           'call original function<br />
           sTerminator = chr&#36;(&amp;h12, &amp;h34, &amp;h56, &amp;h78, &amp;h9A, &amp;hBC, &amp;hDE, &amp;hF0)<br />
           pcode       = codeptr(Add2Numbers)<br />
           RetVal      = 0<br />
           call dword pcode using myfunction(2, 2) to RetVal<br />
           MessageBox(hDlg, "CALL DWORD pcode result =" &amp; str&#36;(RetVal), &#36;AppName, 266240)<br />
           '-----------------------------------------------------------------------------<br />
           'call a copy of original function using myfunction()<br />
           sAsm = ""<br />
           do<br />
             sAsm &amp;= peek&#36;(pcode, 1) 'build sAsm byte by byte to be sure to not access out of bound memory<br />
             incr pcode<br />
             if instr(sAsm, sTerminator) then<br />
                sAsm &amp;= peek&#36;(pcode, 16) 'get the end of function<br />
                exit do<br />
             end if<br />
           loop<br />
           RetVal = 0<br />
           pString = strptr(sAsm)<br />
           call dword pString using myfunction(2, 3) to RetVal<br />
           MessageBox(hDlg, "CALL DWORD pString result =" &amp; str&#36;(RetVal), &#36;AppName, 266240)<br />
           '-------------------------------------------------------------------------------------------------<br />
           'call a copy of original function without using myfunction()<br />
           pString = strptr(sAsm)<br />
           ! push 4<br />
           ! push 2<br />
           call dword pString 'Or you may use !call pcode<br />
           ! mov RetVal, eax<br />
           MessageBox(hDlg, "CALL DWORD ASM result =" &amp; str&#36;(RetVal), &#36;AppName, 266240)<br />
           '-------------------------------------------------------------------------------------------------<br />
           'show the copy and original function code side to side<br />
           MessageBox(hDlg, "pcode:" &amp; &#36;crlf &amp; HexView&#36;(peek&#36;(codeptr(Add2Numbers), len(sAsm))) &amp; &#36;crlf &amp; &#36;crlf &amp; &#36;crlf &amp; _<br />
                      "pString:" &amp; &#36;crlf &amp; HexView&#36;(peek&#36;(codeptr(Add2Numbers), len(sAsm))), &#36;AppName, 266240)<br />
         end if<br />
<br />
     end select<br />
<br />
  end select<br />
<br />
end function<br />
'_____________________________________________________________________________<br />
<br />
function pbmain()<br />
<br />
 dialog font "Segoe UI", 9<br />
 dialog new %hwnd_desktop, &#36;AppName, , , 150, 50, _<br />
 %ws_caption or %ws_minimizebox or %ws_maximizebox or %ws_sizebox or %ws_sysmenu, %ws_ex_left to hDlg<br />
<br />
 control add label, hDlg, %Static01, "codeptr() and strptr() test", 5, 10, 140, 11, %ss_center<br />
<br />
 control add button, hDlg, %Button01, "test codeptr() and strptr()", 15, 25, 120, 15<br />
<br />
 dialog show modal hDlg call DlgProc<br />
<br />
end function<br />
'_____________________________________________________________________________<br />
'</code></div></div>]]></description>
			<content:encoded><![CDATA[<span style="font-weight: bold;" class="mycode_b">Calling opcode string</span> discussion was started at <a href="https://forum.powerbasic.com/forum/user-to-user-discussions/programming/838669-calling-opcode-string-discussion" target="_blank" rel="noopener" class="mycode_url">https://forum.powerbasic.com/forum/user-...discussion</a><br />
<br />
It is an answer To Anne on how to get and embed a function in a string and call it via "call dword"<br />
This one show particularly how to find the end of the function code by inserting data near the end.<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>'follow up of https://forum.powerbasic.com/forum/user-to-user-discussions/programming/838669-calling-opcode-string-discussion<br />
<br />
#compile exe '#Win 10.04 (D:&#92;Dev&#92;Pow&#92;Bas&#92;Jose Roca&#92;Forum&#92;Jose&#92;Windows API Headers&#92;3.1.07&#92;uz)#<br />
#dim all<br />
'#register none<br />
'%Unicode = 1<br />
#include "Win32Api.inc"<br />
<br />
#RESOURCE MANIFEST, 1, "XPTheme.xml"<br />
<br />
global hDlg as dword<br />
<br />
&#36;AppName  = "call dword"<br />
%Static01 = 101<br />
%Button01 = 201<br />
<br />
declare function myfunction(byval var1 as long ,byval var2 as long) as long 'for call dword to use<br />
'_____________________________________________________________________________<br />
<br />
function HexView&#36;(sString as string) as string 'HexString<br />
 local  pByte   as byte pointer<br />
 local  sBuffer as string<br />
 local  sChar16 as string<br />
 local  Looper  as long<br />
<br />
 pByte = strptr(sString)<br />
 do<br />
   if (Looper and 15) = 00 then                 'Like MOD 16<br />
     sBuffer = sBuffer &amp; hex&#36;(Looper, 4) &amp; ": " 'Line number:<br />
   elseif (Looper and 07) = 00 then             'Like MOD 8<br />
     sBuffer = sBuffer &amp; "- "                   'Middle dash<br />
   end if<br />
<br />
   if Looper &lt; len(sString) then                'Add data<br />
     sBuffer = sBuffer &amp; hex&#36;(@pByte[Looper], 2) &amp; &#36;spc<br />
   else<br />
     #if %def(%pb_win32) 'A to F have bigger width<br />
     sBuffer = sBuffer &amp; "     "                'Windows: No more data, fill with five spaces<br />
     #else 'Use STDOUT in console<br />
     sBuffer = sBuffer &amp; "   "                  'Console: No more data, fill with three spaces<br />
     #endif<br />
   end if<br />
<br />
   if (Looper and 15) = 15 then                 'End of 16 bytes line<br />
     sChar16 = mid&#36;(sString, Looper -14, 16) 'Next line replace non visible characters with dot<br />
     replace any chr&#36;(0,1,7,9,10,13,27 to 31,127,129,140,141,143,144,152,157) with "..................." in sChar16<br />
     sBuffer = sBuffer &amp; "; " &amp; sChar16 &amp; &#36;crlf 'Add ascii string and CRLF<br />
     if Looper &gt;= len(sString) - 1 then exit do 'Job done<br />
   end if<br />
<br />
   incr Looper<br />
<br />
 loop<br />
 function = "Binary data lenght is" &amp; str&#36;(len(sString)) &amp; " bytes." &amp; &#36;crlf &amp; sBuffer<br />
<br />
end function<br />
'____________________________________________________________________________<br />
<br />
function Add2Numbers(byval var1 as long ,byval var2 as long) as long<br />
<br />
 function = var1 + var2<br />
 'function = var2<br />
<br />
 exit function<br />
 !DB &amp;h12, &amp;h34, &amp;h56, &amp;h78, &amp;h9A, &amp;hBC, &amp;hDE, &amp;hF0 <br />
<br />
end function<br />
'_____________________________________________________________________________<br />
<br />
callback function DlgProc<br />
 local sAsm        as string<br />
 local sTerminator as string<br />
 local pcode       as dword<br />
 local pString     as dword<br />
 local RetVal      as long<br />
 local byteVal     as byte<br />
<br />
 select case cbmsg<br />
<br />
   case %wm_command<br />
     select case cbctl<br />
<br />
       case %Button01<br />
         if cbctlmsg = %bn_clicked or cbctlmsg = 1 then<br />
           'call original function<br />
           sTerminator = chr&#36;(&amp;h12, &amp;h34, &amp;h56, &amp;h78, &amp;h9A, &amp;hBC, &amp;hDE, &amp;hF0)<br />
           pcode       = codeptr(Add2Numbers)<br />
           RetVal      = 0<br />
           call dword pcode using myfunction(2, 2) to RetVal<br />
           MessageBox(hDlg, "CALL DWORD pcode result =" &amp; str&#36;(RetVal), &#36;AppName, 266240)<br />
           '-----------------------------------------------------------------------------<br />
           'call a copy of original function using myfunction()<br />
           sAsm = ""<br />
           do<br />
             sAsm &amp;= peek&#36;(pcode, 1) 'build sAsm byte by byte to be sure to not access out of bound memory<br />
             incr pcode<br />
             if instr(sAsm, sTerminator) then<br />
                sAsm &amp;= peek&#36;(pcode, 16) 'get the end of function<br />
                exit do<br />
             end if<br />
           loop<br />
           RetVal = 0<br />
           pString = strptr(sAsm)<br />
           call dword pString using myfunction(2, 3) to RetVal<br />
           MessageBox(hDlg, "CALL DWORD pString result =" &amp; str&#36;(RetVal), &#36;AppName, 266240)<br />
           '-------------------------------------------------------------------------------------------------<br />
           'call a copy of original function without using myfunction()<br />
           pString = strptr(sAsm)<br />
           ! push 4<br />
           ! push 2<br />
           call dword pString 'Or you may use !call pcode<br />
           ! mov RetVal, eax<br />
           MessageBox(hDlg, "CALL DWORD ASM result =" &amp; str&#36;(RetVal), &#36;AppName, 266240)<br />
           '-------------------------------------------------------------------------------------------------<br />
           'show the copy and original function code side to side<br />
           MessageBox(hDlg, "pcode:" &amp; &#36;crlf &amp; HexView&#36;(peek&#36;(codeptr(Add2Numbers), len(sAsm))) &amp; &#36;crlf &amp; &#36;crlf &amp; &#36;crlf &amp; _<br />
                      "pString:" &amp; &#36;crlf &amp; HexView&#36;(peek&#36;(codeptr(Add2Numbers), len(sAsm))), &#36;AppName, 266240)<br />
         end if<br />
<br />
     end select<br />
<br />
  end select<br />
<br />
end function<br />
'_____________________________________________________________________________<br />
<br />
function pbmain()<br />
<br />
 dialog font "Segoe UI", 9<br />
 dialog new %hwnd_desktop, &#36;AppName, , , 150, 50, _<br />
 %ws_caption or %ws_minimizebox or %ws_maximizebox or %ws_sizebox or %ws_sysmenu, %ws_ex_left to hDlg<br />
<br />
 control add label, hDlg, %Static01, "codeptr() and strptr() test", 5, 10, 140, 11, %ss_center<br />
<br />
 control add button, hDlg, %Button01, "test codeptr() and strptr()", 15, 25, 120, 15<br />
<br />
 dialog show modal hDlg call DlgProc<br />
<br />
end function<br />
'_____________________________________________________________________________<br />
'</code></div></div>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Puzzle]]></title>
			<link>http://pump.richheimer.de/showthread.php?tid=9</link>
			<pubDate>Sun, 16 Jun 2024 19:21:08 +0000</pubDate>
			<dc:creator><![CDATA[<a href="http://pump.richheimer.de/member.php?action=profile&uid=3">Rodney Hicks</a>]]></dc:creator>
			<guid isPermaLink="false">http://pump.richheimer.de/showthread.php?tid=9</guid>
			<description><![CDATA[A puzzle for those that have time to spare.<br />
<br />
The solution is a regular photograph of me.<br />
Developed with an algorithm on a square image.<br />
Post your resulting image and method to prove you have the solution.<br />
<br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="http://pump.richheimer.de/images/attachtypes/image.png" title="JPG Image" border="0" alt=".jpg" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=3" target="_blank" title="">puzzle1.jpg</a> (Size: 64.68 KB / Downloads: 29)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[A puzzle for those that have time to spare.<br />
<br />
The solution is a regular photograph of me.<br />
Developed with an algorithm on a square image.<br />
Post your resulting image and method to prove you have the solution.<br />
<br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="http://pump.richheimer.de/images/attachtypes/image.png" title="JPG Image" border="0" alt=".jpg" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=3" target="_blank" title="">puzzle1.jpg</a> (Size: 64.68 KB / Downloads: 29)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
	</channel>
</rss>