<?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 - Portal]]></title>
		<link>https://pump.richheimer.de/</link>
		<description><![CDATA[PowerBASIC Users Meeting Point - https://pump.richheimer.de]]></description>
		<pubDate>Wed, 16 Sep 2026 00:13:53 +0000</pubDate>
		<generator>MyBB</generator>
		<item>
			<title><![CDATA[center line not working with add label]]></title>
			<link>https://pump.richheimer.de/showthread.php?tid=134</link>
			<pubDate>Wed, 02 Sep 2026 21:54:01 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://pump.richheimer.de/member.php?action=profile&uid=177">Robert Alvarez</a>]]></dc:creator>
			<guid isPermaLink="false">https://pump.richheimer.de/showthread.php?tid=134</guid>
			<description><![CDATA[#COMPILE EXE<br />
<br />
<br />
FUNCTION PBMAIN() AS LONG<br />
LOCAL hDlg AS LONG<br />
DIALOG NEW 0, "SET center Line Test",,,480,300, %WS_SYSMENU, 0 TO hDlg<br />
<br />
LOCAL AA AS STRING<br />
<br />
AA= STRING&#36;(10, 151)<br />
<br />
            ? AA    'PRINT LINES BELOW DOES NOT<br />
<br />
CONTROL ADD LABEL, hDlg, 203,AA , 55, 70,75,450,<br />
<br />
CONTROL ADD LABEL, hDlg, 203,STRING&#36;(10, 151) , 55, 80,75,450,<br />
<br />
DIALOG SHOW MODAL hDlg<br />
END FUNCTION]]></description>
			<content:encoded><![CDATA[#COMPILE EXE<br />
<br />
<br />
FUNCTION PBMAIN() AS LONG<br />
LOCAL hDlg AS LONG<br />
DIALOG NEW 0, "SET center Line Test",,,480,300, %WS_SYSMENU, 0 TO hDlg<br />
<br />
LOCAL AA AS STRING<br />
<br />
AA= STRING&#36;(10, 151)<br />
<br />
            ? AA    'PRINT LINES BELOW DOES NOT<br />
<br />
CONTROL ADD LABEL, hDlg, 203,AA , 55, 70,75,450,<br />
<br />
CONTROL ADD LABEL, hDlg, 203,STRING&#36;(10, 151) , 55, 80,75,450,<br />
<br />
DIALOG SHOW MODAL hDlg<br />
END FUNCTION]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Euclidean division; quotient and remainder 1 call]]></title>
			<link>https://pump.richheimer.de/showthread.php?tid=133</link>
			<pubDate>Mon, 31 Aug 2026 04:25:30 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://pump.richheimer.de/member.php?action=profile&uid=23">Dale Yarker</a>]]></dc:creator>
			<guid isPermaLink="false">https://pump.richheimer.de/showthread.php?tid=133</guid>
			<description><![CDATA[Euclidean division results for negative dividends are different from regular integer divide and MOD which are 2 operations. <br />
<br />
These functions each return both quotient and remainder in BYREF variables.<br />
<br />
The function for LONGs is assembly. For now the QUADs is BASIC; assembly will take more work.<br />
<br />
This is also at <a href="https://www.yarker-dsyc.info/Programs/Misc/DivisionQuoAndRmndr/EuclidDiv.html" target="_blank" rel="noopener" class="mycode_url">https://www.yarker-dsyc.info/Programs/Mi...idDiv.html</a> with a few more words.<br />
<br />
To make a set tuncate functions are at <a href="https://www.yarker-dsyc.info/Programs/Misc/DivisionQuoAndRmndr/TruncateDiv.html" target="_blank" rel="noopener" class="mycode_url">https://www.yarker-dsyc.info/Programs/Mi...teDiv.html</a><br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>''The remainder/modulo operation performed by Intel math coprocessors (FPREM<br />
''and FPREM1 instructions) is not Euclidean, Intel's idiv assembly instruction<br />
''is not Euclidean division. They are both IEEE Standard 754.<br />
''In Euclidean division the remainder is never negative. For negative dividends<br />
''the quotient is 1 different than expected.<br />
''From Google- "An example use of Euclidean division with a negative dividend<br />
''is finding a repeating time or calendar offset, such as calculating what hour<br />
''of the day it was a certain number of hours ago.<br />
#compile exe<br />
#dim all<br />
#if %def(%pb_cc32) 'if PBCC<br />
  #console off    'don't create a console window<br />
#endif<br />
'========================== Euclidean Division Of LONGs ========================<br />
function EuclidDivide (byval Dividend as long, _<br />
                      byval Divisor as long, _<br />
                      byref Quotient as long, _<br />
                      byref Remainder as long) as long<br />
  '<br />
  ! mov ebx, Divisor<br />
  ! cmp ebx, 0<br />
  ! jne DoDivide<br />
  ! mov function, %err_divisionbyzero<br />
  ! jmp Done<br />
  DoDivide:<br />
  ! mov esi, Quotient  'Quotient and Remainder pointers to registers<br />
  ! mov edi, Remainder<br />
  '<br />
  ! mov eax, Dividend  'load the dividend<br />
  ! cdq                'sign-extend EAX into EDX:EAX<br />
  ! idiv ebx            'EDX:EAX / ECX<br />
  '<br />
  'adjust to Euclidean results<br />
  ! cmp edx, 0      'remainder &lt; 0<br />
  ! jl RmndrLT0<br />
  ! jmp Results<br />
  RmndrLT0:<br />
    ! cmp ebx, 0    'divisor &gt; 0<br />
    ! jg DvsrGT0<br />
      ! add eax, 1<br />
      ! sub edx, ebx<br />
      ! jmp Results<br />
    DvsrGT0:<br />
      ! sub eax, 1<br />
      ! add edx, ebx<br />
  '<br />
  'set result variables<br />
  Results:<br />
  ! mov [esi], eax<br />
  ! mov [edi], edx<br />
  Done:<br />
end function<br />
'<br />
'========================== Euclidean Division Of QUADs ========================<br />
'For QUAD the only change is the type of the parameters.<br />
function EuclidDivideQuad (byval Dividend as quad, _<br />
                          byval Divisor as quad, _<br />
                          byref Quotient as quad, _<br />
                          byref Remainder as quad) as long<br />
  '------------------------<br />
  if Divisor = 0 then<br />
    Quotient = 0<br />
    Remainder = 0<br />
    function = %err_divisionbyzero<br />
    exit function<br />
  end if<br />
  '<br />
  Quotient = Dividend &#92; Divisor<br />
  Remainder = Dividend mod Divisor<br />
  '<br />
  if Remainder &lt; 0 then<br />
    if Divisor &gt; 0 then<br />
      Quotient -= 1<br />
      Remainder += Divisor<br />
    else<br />
      Quotient += 1<br />
      Remainder -= Divisor<br />
    end if<br />
  end if<br />
end function<br />
'<br />
'/&#92;/&#92;/&#92;/&#92;/&#92;/&#92;/&#92;/&#92;/&#92;/&#92;/&#92; Demonstrate Euclidian Division /&#92;/&#92;/&#92;/&#92;/&#92;/&#92;/&#92;/&#92;/&#92;/&#92;/&#92;/&#92;<br />
function pbmain () as long<br />
  local hTWin as dword<br />
  local QuotientQ, RemainderQ as quad<br />
  local Quotient, Remainder, ErrNum as long<br />
  local FmtLg, FmtQd as string<br />
  txt.window("Euclidian Division Demonstration", 200, 200, 18, 64) to hTWin<br />
  '<br />
  FmtLg = " #;-#; 0"<br />
  FmtQd = " ###########;-###########; 0"<br />
  '================================== Long =====================================<br />
  txt.print "type LONG"<br />
  ErrNum = EuclidDivide(9, 0, Quotient, Remainder)<br />
  txt.print " 9 /  0 = " + format&#36;(Quotient, FmtLg) + " R" + _<br />
    format&#36;(Remainder, FmtLg) + "  error code = " + dec&#36;(ErrNum, 2)<br />
  '<br />
  ErrNum = EuclidDivide(9, 4, Quotient, Remainder)<br />
  txt.print " 9 /  4 = " + format&#36;(Quotient, FmtLg) + " R" + _<br />
    format&#36;(Remainder, FmtLg) + "  error code = " + dec&#36;(ErrNum, 2)<br />
  '<br />
  ErrNum = EuclidDivide(9, -4, Quotient, Remainder)<br />
  txt.print " 9 / -4 = " + format&#36;(Quotient, FmtLg) + " R" + _<br />
    format&#36;(Remainder, FmtLg) + "  error code = " + dec&#36;(ErrNum, 2)<br />
  '<br />
  ErrNum = EuclidDivide(-9, 4, Quotient, Remainder)<br />
  txt.print "-9 /  4 = " + format&#36;(Quotient, FmtLg) + " R" + _<br />
    format&#36;(Remainder, FmtLg) + "  error code = " + dec&#36;(ErrNum, 2)<br />
  '<br />
  ErrNum = EuclidDivide(-9, -4, Quotient, Remainder)<br />
  txt.print "-9 / -4 = " + format&#36;(Quotient, FmtLg) + " R" + _<br />
    format&#36;(Remainder, FmtLg) + "  error code = " + dec&#36;(ErrNum, 2)<br />
  '<br />
  '================================== Quad =====================================<br />
  txt.print<br />
  txt.print "type QUAD"<br />
  ErrNum = EuclidDivideQuad(90000000000, 0, QuotientQ, RemainderQ)<br />
  txt.print " 90000000000 /            0 = " + _<br />
    format&#36;(QuotientQ, FmtQd) + " R" + format&#36;(RemainderQ, FmtQd) + _<br />
    "  error code "  + dec&#36;(ErrNum, 2)<br />
  '<br />
  ErrNum = EuclidDivideQuad(90000000000, 40000000000, QuotientQ, RemainderQ)<br />
  txt.print " 90000000000 /  40000000000 = " + _<br />
    format&#36;(QuotientQ, FmtQd) + " R" + format&#36;(RemainderQ, FmtQd) + _<br />
    "  error code "  + dec&#36;(ErrNum, 2)<br />
  '<br />
  ErrNum = EuclidDivideQuad(90000000000, -40000000000, QuotientQ, RemainderQ)<br />
  txt.print " 90000000000 / -40000000000 = " + _<br />
    format&#36;(QuotientQ, FmtQd) + " R" + format&#36;(RemainderQ, FmtQd) + _<br />
    "  error code "  + dec&#36;(ErrNum, 2)<br />
  '<br />
  ErrNum = EuclidDivideQuad(-90000000000, 40000000000, QuotientQ, RemainderQ)<br />
  txt.print "-90000000000 /  40000000000 = " + _<br />
    format&#36;(QuotientQ, FmtQd) + " R" + format&#36;(RemainderQ, FmtQd) + _<br />
    "  error code "  + dec&#36;(ErrNum, 2)<br />
  '<br />
  ErrNum = EuclidDivideQuad(-90000000000, -40000000000, QuotientQ, RemainderQ)<br />
  txt.print "-90000000000 / -40000000000 = " + _<br />
    format&#36;(QuotientQ, FmtQd) + " R" + format&#36;(RemainderQ, FmtQd) + _<br />
    "  error code "  + dec&#36;(ErrNum, 2)<br />
  '<br />
  txt.print<br />
  txt.print<br />
  txt.color = &amp;h0000C000<br />
  txt.print "Any key to close."<br />
  txt.waitkey&#36;<br />
  txt.end<br />
end function</code></div></div>]]></description>
			<content:encoded><![CDATA[Euclidean division results for negative dividends are different from regular integer divide and MOD which are 2 operations. <br />
<br />
These functions each return both quotient and remainder in BYREF variables.<br />
<br />
The function for LONGs is assembly. For now the QUADs is BASIC; assembly will take more work.<br />
<br />
This is also at <a href="https://www.yarker-dsyc.info/Programs/Misc/DivisionQuoAndRmndr/EuclidDiv.html" target="_blank" rel="noopener" class="mycode_url">https://www.yarker-dsyc.info/Programs/Mi...idDiv.html</a> with a few more words.<br />
<br />
To make a set tuncate functions are at <a href="https://www.yarker-dsyc.info/Programs/Misc/DivisionQuoAndRmndr/TruncateDiv.html" target="_blank" rel="noopener" class="mycode_url">https://www.yarker-dsyc.info/Programs/Mi...teDiv.html</a><br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>''The remainder/modulo operation performed by Intel math coprocessors (FPREM<br />
''and FPREM1 instructions) is not Euclidean, Intel's idiv assembly instruction<br />
''is not Euclidean division. They are both IEEE Standard 754.<br />
''In Euclidean division the remainder is never negative. For negative dividends<br />
''the quotient is 1 different than expected.<br />
''From Google- "An example use of Euclidean division with a negative dividend<br />
''is finding a repeating time or calendar offset, such as calculating what hour<br />
''of the day it was a certain number of hours ago.<br />
#compile exe<br />
#dim all<br />
#if %def(%pb_cc32) 'if PBCC<br />
  #console off    'don't create a console window<br />
#endif<br />
'========================== Euclidean Division Of LONGs ========================<br />
function EuclidDivide (byval Dividend as long, _<br />
                      byval Divisor as long, _<br />
                      byref Quotient as long, _<br />
                      byref Remainder as long) as long<br />
  '<br />
  ! mov ebx, Divisor<br />
  ! cmp ebx, 0<br />
  ! jne DoDivide<br />
  ! mov function, %err_divisionbyzero<br />
  ! jmp Done<br />
  DoDivide:<br />
  ! mov esi, Quotient  'Quotient and Remainder pointers to registers<br />
  ! mov edi, Remainder<br />
  '<br />
  ! mov eax, Dividend  'load the dividend<br />
  ! cdq                'sign-extend EAX into EDX:EAX<br />
  ! idiv ebx            'EDX:EAX / ECX<br />
  '<br />
  'adjust to Euclidean results<br />
  ! cmp edx, 0      'remainder &lt; 0<br />
  ! jl RmndrLT0<br />
  ! jmp Results<br />
  RmndrLT0:<br />
    ! cmp ebx, 0    'divisor &gt; 0<br />
    ! jg DvsrGT0<br />
      ! add eax, 1<br />
      ! sub edx, ebx<br />
      ! jmp Results<br />
    DvsrGT0:<br />
      ! sub eax, 1<br />
      ! add edx, ebx<br />
  '<br />
  'set result variables<br />
  Results:<br />
  ! mov [esi], eax<br />
  ! mov [edi], edx<br />
  Done:<br />
end function<br />
'<br />
'========================== Euclidean Division Of QUADs ========================<br />
'For QUAD the only change is the type of the parameters.<br />
function EuclidDivideQuad (byval Dividend as quad, _<br />
                          byval Divisor as quad, _<br />
                          byref Quotient as quad, _<br />
                          byref Remainder as quad) as long<br />
  '------------------------<br />
  if Divisor = 0 then<br />
    Quotient = 0<br />
    Remainder = 0<br />
    function = %err_divisionbyzero<br />
    exit function<br />
  end if<br />
  '<br />
  Quotient = Dividend &#92; Divisor<br />
  Remainder = Dividend mod Divisor<br />
  '<br />
  if Remainder &lt; 0 then<br />
    if Divisor &gt; 0 then<br />
      Quotient -= 1<br />
      Remainder += Divisor<br />
    else<br />
      Quotient += 1<br />
      Remainder -= Divisor<br />
    end if<br />
  end if<br />
end function<br />
'<br />
'/&#92;/&#92;/&#92;/&#92;/&#92;/&#92;/&#92;/&#92;/&#92;/&#92;/&#92; Demonstrate Euclidian Division /&#92;/&#92;/&#92;/&#92;/&#92;/&#92;/&#92;/&#92;/&#92;/&#92;/&#92;/&#92;<br />
function pbmain () as long<br />
  local hTWin as dword<br />
  local QuotientQ, RemainderQ as quad<br />
  local Quotient, Remainder, ErrNum as long<br />
  local FmtLg, FmtQd as string<br />
  txt.window("Euclidian Division Demonstration", 200, 200, 18, 64) to hTWin<br />
  '<br />
  FmtLg = " #;-#; 0"<br />
  FmtQd = " ###########;-###########; 0"<br />
  '================================== Long =====================================<br />
  txt.print "type LONG"<br />
  ErrNum = EuclidDivide(9, 0, Quotient, Remainder)<br />
  txt.print " 9 /  0 = " + format&#36;(Quotient, FmtLg) + " R" + _<br />
    format&#36;(Remainder, FmtLg) + "  error code = " + dec&#36;(ErrNum, 2)<br />
  '<br />
  ErrNum = EuclidDivide(9, 4, Quotient, Remainder)<br />
  txt.print " 9 /  4 = " + format&#36;(Quotient, FmtLg) + " R" + _<br />
    format&#36;(Remainder, FmtLg) + "  error code = " + dec&#36;(ErrNum, 2)<br />
  '<br />
  ErrNum = EuclidDivide(9, -4, Quotient, Remainder)<br />
  txt.print " 9 / -4 = " + format&#36;(Quotient, FmtLg) + " R" + _<br />
    format&#36;(Remainder, FmtLg) + "  error code = " + dec&#36;(ErrNum, 2)<br />
  '<br />
  ErrNum = EuclidDivide(-9, 4, Quotient, Remainder)<br />
  txt.print "-9 /  4 = " + format&#36;(Quotient, FmtLg) + " R" + _<br />
    format&#36;(Remainder, FmtLg) + "  error code = " + dec&#36;(ErrNum, 2)<br />
  '<br />
  ErrNum = EuclidDivide(-9, -4, Quotient, Remainder)<br />
  txt.print "-9 / -4 = " + format&#36;(Quotient, FmtLg) + " R" + _<br />
    format&#36;(Remainder, FmtLg) + "  error code = " + dec&#36;(ErrNum, 2)<br />
  '<br />
  '================================== Quad =====================================<br />
  txt.print<br />
  txt.print "type QUAD"<br />
  ErrNum = EuclidDivideQuad(90000000000, 0, QuotientQ, RemainderQ)<br />
  txt.print " 90000000000 /            0 = " + _<br />
    format&#36;(QuotientQ, FmtQd) + " R" + format&#36;(RemainderQ, FmtQd) + _<br />
    "  error code "  + dec&#36;(ErrNum, 2)<br />
  '<br />
  ErrNum = EuclidDivideQuad(90000000000, 40000000000, QuotientQ, RemainderQ)<br />
  txt.print " 90000000000 /  40000000000 = " + _<br />
    format&#36;(QuotientQ, FmtQd) + " R" + format&#36;(RemainderQ, FmtQd) + _<br />
    "  error code "  + dec&#36;(ErrNum, 2)<br />
  '<br />
  ErrNum = EuclidDivideQuad(90000000000, -40000000000, QuotientQ, RemainderQ)<br />
  txt.print " 90000000000 / -40000000000 = " + _<br />
    format&#36;(QuotientQ, FmtQd) + " R" + format&#36;(RemainderQ, FmtQd) + _<br />
    "  error code "  + dec&#36;(ErrNum, 2)<br />
  '<br />
  ErrNum = EuclidDivideQuad(-90000000000, 40000000000, QuotientQ, RemainderQ)<br />
  txt.print "-90000000000 /  40000000000 = " + _<br />
    format&#36;(QuotientQ, FmtQd) + " R" + format&#36;(RemainderQ, FmtQd) + _<br />
    "  error code "  + dec&#36;(ErrNum, 2)<br />
  '<br />
  ErrNum = EuclidDivideQuad(-90000000000, -40000000000, QuotientQ, RemainderQ)<br />
  txt.print "-90000000000 / -40000000000 = " + _<br />
    format&#36;(QuotientQ, FmtQd) + " R" + format&#36;(RemainderQ, FmtQd) + _<br />
    "  error code "  + dec&#36;(ErrNum, 2)<br />
  '<br />
  txt.print<br />
  txt.print<br />
  txt.color = &amp;h0000C000<br />
  txt.print "Any key to close."<br />
  txt.waitkey&#36;<br />
  txt.end<br />
end function</code></div></div>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Where is pbusers.org?]]></title>
			<link>https://pump.richheimer.de/showthread.php?tid=132</link>
			<pubDate>Tue, 04 Aug 2026 09:42:38 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://pump.richheimer.de/member.php?action=profile&uid=54">Borje Hagsten</a>]]></dc:creator>
			<guid isPermaLink="false">https://pump.richheimer.de/showthread.php?tid=132</guid>
			<description><![CDATA[It's been hard to visit pbusers.org lately and now it's totally gone. Anyone knows why?]]></description>
			<content:encoded><![CDATA[It's been hard to visit pbusers.org lately and now it's totally gone. Anyone knows why?]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Is PBUsers.org broken?]]></title>
			<link>https://pump.richheimer.de/showthread.php?tid=131</link>
			<pubDate>Tue, 04 Aug 2026 09:40:02 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://pump.richheimer.de/member.php?action=profile&uid=1">Albert Richheimer</a>]]></dc:creator>
			<guid isPermaLink="false">https://pump.richheimer.de/showthread.php?tid=131</guid>
			<description><![CDATA[Hello @all,<br />
especially @George Bleck<br />
<br />
Did you notice that since a few days PBUsers.org doesn't work any more? By trying many times again I might pass the blocking. This happens with Firefox as well with SRWare Iron (Chrome Engine).<br />
<br />
This is what I usually see when trying to visit PBUsers.org:<br />
<br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://pump.richheimer.de/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=70" target="_blank" title="">CropImage.png</a> (Size: 50.17 KB / Downloads: 0)
<!-- end: postbit_attachments_attachment --><br />
<br />
Cheers,<br />
Albert]]></description>
			<content:encoded><![CDATA[Hello @all,<br />
especially @George Bleck<br />
<br />
Did you notice that since a few days PBUsers.org doesn't work any more? By trying many times again I might pass the blocking. This happens with Firefox as well with SRWare Iron (Chrome Engine).<br />
<br />
This is what I usually see when trying to visit PBUsers.org:<br />
<br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://pump.richheimer.de/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=70" target="_blank" title="">CropImage.png</a> (Size: 50.17 KB / Downloads: 0)
<!-- end: postbit_attachments_attachment --><br />
<br />
Cheers,<br />
Albert]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Does PB progs run well in WINE?]]></title>
			<link>https://pump.richheimer.de/showthread.php?tid=130</link>
			<pubDate>Mon, 27 Jul 2026 13:58:56 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://pump.richheimer.de/member.php?action=profile&uid=5">Mannish Bhandari</a>]]></dc:creator>
			<guid isPermaLink="false">https://pump.richheimer.de/showthread.php?tid=130</guid>
			<description><![CDATA[I saw this video <a href="https://www.youtube.com/watch?v=1ffjb0Eq0po" target="_blank" rel="noopener" class="mycode_url">https://www.youtube.com/watch?v=1ffjb0Eq0po</a><br />
which states that windows apps can run be run in linux WINE <br />
<br />
Did anyone try this  try running PB progs in Wine ? and what's your opinions on this WINE ?]]></description>
			<content:encoded><![CDATA[I saw this video <a href="https://www.youtube.com/watch?v=1ffjb0Eq0po" target="_blank" rel="noopener" class="mycode_url">https://www.youtube.com/watch?v=1ffjb0Eq0po</a><br />
which states that windows apps can run be run in linux WINE <br />
<br />
Did anyone try this  try running PB progs in Wine ? and what's your opinions on this WINE ?]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[FFTW - Attn Dan Soper]]></title>
			<link>https://pump.richheimer.de/showthread.php?tid=129</link>
			<pubDate>Tue, 19 May 2026 12:57:23 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://pump.richheimer.de/member.php?action=profile&uid=125">Ian Vincent</a>]]></dc:creator>
			<guid isPermaLink="false">https://pump.richheimer.de/showthread.php?tid=129</guid>
			<description><![CDATA[Dan, I saw your post on the pbusers.org site. I am not registered there.<br />
I have played with FFTW in the past. <br />
It was a long time ago though, so not sure if everything you need is here, but it might get you started.<br />
I could never make sense of the licencing for FFTW so moved to the Intel IPP, now OneAPI lib.<br />
It includes a lot of other useful functions, but it takes a while to get into it<br />
<br />
<br />
Here are my Declares:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>%FFTW_FORWARD =-1<br />
%FFTW_BACKWARD =1<br />
%FFTW_ESTIMATE =64  '(1U &lt;&lt; 6)  in c(rap)/c(razy) notation. IE bit 6 is set<br />
Enum R2RTransformKinds<br />
    HalfComplexDFT = 0<br />
    HalfComplexIDFT = 1<br />
    DHT = 2<br />
    DCT1 = 3<br />
    DCT2 = 5<br />
    DCT3 = 4<br />
    DCT4 = 6<br />
    DST1 = 7<br />
    DST2 = 9<br />
    DST3 = 8<br />
    DST4 = 10<br />
End Enum<br />
<br />
#If %DEF(%FFTW_Double)<br />
Type complex<br />
    real As Double<br />
    Imag As Double<br />
End Type<br />
<br />
<br />
Declare Function fftw_plan_dft Lib "libfftw3-3.dll" CDecl Alias "fftw_plan_dft" (ByVal DimCount As Long, ByRef DimSizes As Long, ByRef Src As Double, ByRef Dest As Double, ByVal Sign As Long, ByVal Flags As Long) As Long<br />
Declare Function fftw_plan_dft_1d Lib "libfftw3-3.dll" CDecl Alias "fftw_plan_dft_1d" (ByVal Dim1Size As Long, ByRef Src As Double, ByRef Dest As Double, ByVal Sign As Long, ByVal Flags As Long) As Long<br />
Declare Function fftw_plan_dft_2d Lib "libfftw3-3.dll" CDecl Alias "fftw_plan_dft_2d" (ByVal Dim1Size As Long, ByVal Dim2Size As Long, ByRef Src As Double, ByRef Dest As Double, ByVal Sign As Long, ByVal Flags As Long) As Long<br />
Declare Function fftw_plan_dft_3d Lib "libfftw3-3.dll" CDecl Alias "fftw_plan_dft_3d" (ByVal Dim1Size As Long, ByVal Dim2Size As Long, ByVal Dim3Size As Long, ByRef Src As Double, ByRef Dest As Double, ByVal Sign As Long, ByVal Flags As Long) As Long<br />
<br />
Declare Function fftw_plan_dft_r2c Lib "libfftw3-3.dll" CDecl Alias "fftw_plan_dft_r2c" (ByVal DimCount As Long, ByRef DimSizes As Long, ByRef Src As Double, ByRef Dest As Double, ByVal Flags As Long) As Long<br />
Declare Function fftw_plan_dft_r2c_1d Lib "libfftw3-3.dll" CDecl Alias "fftw_plan_dft_r2c_1d" (ByVal Dim1Size As Long, ByRef Src As Double, ByRef Dest As complex, ByVal Flags As Long) As Long<br />
Declare Function fftw_plan_dft_r2c_2d Lib "libfftw3-3.dll" CDecl Alias "fftw_plan_dft_r2c_2d" (ByVal Dim1Size As Long, ByVal Dim2Size As Long, ByRef Src As Double, ByRef Dest As Double, ByVal Flags As Long) As Long<br />
Declare Function fftw_plan_dft_r2c_3d Lib "libfftw3-3.dll" CDecl Alias "fftw_plan_dft_r2c_3d" (ByVal Dim1Size As Long, ByVal Dim2Size As Long, ByVal Dim3Size As Long, ByRef Src As Double, ByRef Dest As Double, ByVal Flags As Long) As Long<br />
<br />
Declare Function fftw_plan_dft_c2r Lib "libfftw3-3.dll" CDecl Alias "fftw_plan_dft_c2r" (ByVal DimCount As Long, ByRef DimSizes As Long, ByRef Src As Double, ByRef Dest As Double, ByVal Flags As Long) As Long<br />
Declare Function fftw_plan_dft_c2r_1d Lib "libfftw3-3.dll" CDecl Alias "fftw_plan_dft_c2r_1d" (ByVal Dim1Size As Long, ByRef Src As Double, ByRef Dest As Double, ByVal Flags As Long) As Long<br />
Declare Function fftw_plan_dft_c2r_2d Lib "libfftw3-3.dll" CDecl Alias "fftw_plan_dft_c2r_2d" (ByVal Dim1Size As Long, ByVal Dim2Size As Long, ByRef Src As Double, ByRef Dest As Double, ByVal Flags As Long) As Long<br />
Declare Function fftw_plan_dft_c2r_3d Lib "libfftw3-3.dll" CDecl Alias "fftw_plan_dft_c2r_3d" (ByVal Dim1Size As Long, ByVal Dim2Size As Long, ByVal Dim3Size As Long, ByRef Src As Double, ByRef Dest As Double, ByVal Flags As Long) As Long<br />
<br />
Declare Function fftw_plan_r2r Lib "libfftw3-3.dll" CDecl Alias "fftw_plan_r2r" (ByVal DimCount As Long, ByRef DimSizes As Long, ByRef Src As Double, ByRef Dest As Double, ByRef TransformKinds As Long, ByVal Flags As Long) As Long<br />
Declare Function fftw_plan_r2r_1d Lib "libfftw3-3.dll" CDecl Alias "fftw_plan_r2r_1d" (ByVal Dim1Size As Long, ByRef Src As Double, ByRef Dest As Double, ByVal Dim1TransformKind As Long, ByVal Flags As Long) As Long<br />
<br />
Declare Function fftw_plan_r2r_2d Lib "libfftw3-3.dll" CDecl Alias "fftw_plan_r2r_2d" (ByVal Dim1Size As Long, ByVal Dim2Size As Long, ByRef Src As Double, ByRef Dest As Double, _<br />
ByVal Dim1TransformKind As Long, ByVal Dim2TransformKind As Long, ByVal Flags As Long) As Long<br />
<br />
Declare Function fftw_plan_r2r_3d Lib "libfftw3-3.dll" CDecl Alias "fftw_plan_r2r_3d" (ByVal Dim1Size As Long, ByVal Dim2Size As Long, ByVal Dim3Size As Long, ByRef Src As Double, _<br />
ByRef Dest As Double, ByVal Dim1TransformKind As Long, ByVal Dim2TransformKind As Long, ByVal Dim3TransformKind As Long, ByVal Flags As Long) As Long<br />
<br />
Declare Sub fftw_execute Lib "libfftw3-3.dll" CDecl Alias "fftw_execute" (ByVal Plan As Long)<br />
Declare Sub fftw_execute_dft Lib "libfftw3-3.dll" CDecl Alias "fftw_execute_dft" (ByVal Plan As Long, ByRef Src As Double, ByRef Dest As Double)<br />
Declare Sub fftw_execute_dft_r2c Lib "libfftw3-3.dll" CDecl Alias "fftw_execute_dft_r2c" (ByVal Plan As Long, ByRef Src As Double, ByRef Dest As Double)<br />
Declare Sub fftw_execute_dft_c2r Lib "libfftw3-3.dll" CDecl Alias "fftw_execute_dft_c2r" (ByVal Plan As Long, ByRef Src As Double, ByRef Dest As Double)<br />
Declare Sub fftw_execute_r2r Lib "libfftw3-3.dll" CDecl Alias "fftw_execute_r2r" (ByVal Plan As Long, ByRef Src As Double, ByRef Dest As Double)<br />
<br />
Declare Sub fftw_destroy_plan Lib "libfftw3-3.dll" CDecl Alias "fftw_destroy_plan" (ByVal Plan As Long)<br />
Declare Sub fftw_cleanup Lib "libfftw3-3.dll" CDecl Alias "fftw_cleanup" ()<br />
#EndIf<br />
<br />
#If %DEF(%FFTW_Single)<br />
Type complex<br />
    real As Single<br />
    Imag As Single<br />
End Type<br />
<br />
                                    <br />
Declare Function fftw_plan_dft Lib "libfftw3f-3.dll" CDecl Alias "fftwf_plan_dft" (ByVal DimCount As Long, ByRef DimSizes As Long, ByRef Src As Single, ByRef Dest As Single, ByVal Sign As Long, ByVal Flags As Long) As Long<br />
Declare Function fftw_plan_dft_1d Lib "libfftw3f-3.dll" CDecl Alias "fftwf_plan_dft_1d" (ByVal Dim1Size As Long, ByRef Src As Single, ByRef Dest As Single, ByVal Sign As Long, ByVal Flags As Long) As Long<br />
Declare Function fftw_plan_dft_2d Lib "libfftw3f-3.dll" CDecl Alias "fftwf_plan_dft_2d" (ByVal Dim1Size As Long, ByVal Dim2Size As Long, ByRef Src As Single, ByRef Dest As Single, ByVal Sign As Long, ByVal Flags As Long) As Long<br />
Declare Function fftw_plan_dft_3d Lib "libfftw3f-3.dll" CDecl Alias "fftwf_plan_dft_3d" (ByVal Dim1Size As Long, ByVal Dim2Size As Long, ByVal Dim3Size As Long, ByRef Src As Single, ByRef Dest As Single, ByVal Sign As Long, ByVal Flags As Long) As Long<br />
<br />
Declare Function fftw_plan_dft_r2c Lib "libfftw3f-3.dll" CDecl Alias "fftwf_plan_dft_r2c" (ByVal DimCount As Long, ByRef DimSizes As Long, ByRef Src As Single, ByRef Dest As Single, ByVal Flags As Long) As Long<br />
Declare Function fftw_plan_dft_r2c_1d Lib "libfftw3f-3.dll" CDecl Alias "fftwf_plan_dft_r2c_1d" (ByVal Dim1Size As Long, ByRef Src As Single, ByRef Dest As complex, ByVal Flags As Long) As Long<br />
<br />
Declare Function fftw_plan_dft_r2c_2d Lib "libfftw3f-3.dll" CDecl Alias "fftwf_plan_dft_r2c_2d" (ByVal Dim1Size As Long, ByVal Dim2Size As Long, ByRef Src As Single, ByRef Dest As Single, ByVal Flags As Long) As Long<br />
Declare Function fftw_plan_dft_r2c_3d Lib "libfftw3f-3.dll" CDecl Alias "fftwf_plan_dft_r2c_3d" (ByVal Dim1Size As Long, ByVal Dim2Size As Long, ByVal Dim3Size As Long, ByRef Src As Single, ByRef Dest As Single, ByVal Flags As Long) As Long<br />
<br />
Declare Function fftw_plan_dft_c2r Lib "libfftw3f-3.dll" CDecl Alias "fftwf_plan_dft_c2r" (ByVal DimCount As Long, ByRef DimSizes As Long, ByRef Src As Single, ByRef Dest As Single, ByVal Flags As Long) As Long<br />
Declare Function fftw_plan_dft_c2r_1d Lib "libfftw3f-3.dll" CDecl Alias "fftwf_plan_dft_c2r_1d" (ByVal Dim1Size As Long, ByRef Src As Single, ByRef Dest As Single, ByVal Flags As Long) As Long<br />
Declare Function fftw_plan_dft_c2r_2d Lib "libfftw3f-3.dll" CDecl Alias "fftwf_plan_dft_c2r_2d" (ByVal Dim1Size As Long, ByVal Dim2Size As Long, ByRef Src As Single, ByRef Dest As Single, ByVal Flags As Long) As Long<br />
Declare Function fftw_plan_dft_c2r_3d Lib "libfftw3f-3.dll" CDecl Alias "fftwf_plan_dft_c2r_3d" (ByVal Dim1Size As Long, ByVal Dim2Size As Long, ByVal Dim3Size As Long, ByRef Src As Single, ByRef Dest As Single, ByVal Flags As Long) As Long<br />
<br />
Declare Function fftw_plan_r2r Lib "libfftw3f-3.dll" CDecl Alias "fftwf_plan_r2r" (ByVal DimCount As Long, ByRef DimSizes As Long, ByRef Src As Single, ByRef Dest As Single, ByRef TransformKinds As Long, ByVal Flags As Long) As Long<br />
Declare Function fftw_plan_r2r_1d Lib "libfftw3f-3.dll" CDecl Alias "fftwf_plan_r2r_1d" (ByVal Dim1Size As Long, ByRef Src As Single, ByRef Dest As Single, ByVal Dim1TransformKind As Long, ByVal Flags As Long) As Long<br />
<br />
Declare Function fftw_plan_r2r_2d Lib "libfftw3f-3.dll" CDecl Alias "fftwf_plan_r2r_2d" (ByVal Dim1Size As Long, ByVal Dim2Size As Long, ByRef Src As Single, ByRef Dest As Single, _<br />
ByVal Dim1TransformKind As Long, ByVal Dim2TransformKind As Long, ByVal Flags As Long) As Long<br />
<br />
Declare Function fftw_plan_r2r_3d Lib "libfftw3f-3.dll" CDecl Alias "fftwf_plan_r2r_3d" (ByVal Dim1Size As Long, ByVal Dim2Size As Long, ByVal Dim3Size As Long, ByRef Src As Single, _<br />
ByRef Dest As Single, ByVal Dim1TransformKind As Long, ByVal Dim2TransformKind As Long, ByVal Dim3TransformKind As Long, ByVal Flags As Long) As Long<br />
<br />
Declare Sub fftw_execute Lib "libfftw3f-3.dll" CDecl Alias "fftwf_execute" (ByVal Plan As Long)<br />
Declare Sub fftw_execute_dft Lib "libfftw3f-3.dll" CDecl Alias "fftwf_execute_dft" (ByVal Plan As Long, ByRef Src As Single, ByRef Dest As Single)<br />
Declare Sub fftw_execute_dft_r2c Lib "libfftw3f-3.dll" CDecl Alias "fftwf_execute_dft_r2c" (ByVal Plan As Long, ByRef Src As Single, ByRef Dest As Single)<br />
Declare Sub fftw_execute_dft_c2r Lib "libfftw3f-3.dll" CDecl Alias "fftwf_execute_dft_c2r" (ByVal Plan As Long, ByRef Src As Single, ByRef Dest As Single)<br />
Declare Sub fftw_execute_r2r Lib "libfftw3f-3.dll" CDecl Alias "fftwf_execute_r2r" (ByVal Plan As Long, ByRef Src As Single, ByRef Dest As Single)<br />
<br />
Declare Sub fftw_destroy_plan Lib "libfftw3f-3.dll" CDecl Alias "fftwf_destroy_plan" (ByVal Plan As Long)<br />
Declare Sub fftw_cleanup Lib "libfftw3f-3.dll" CDecl Alias "fftwf_cleanup" ()<br />
#EndIf<br />
<br />
<br />
<br />
And this is how I used it (sinearray is as it suggests an array of samples containing a sinwave):<br />
<br />
Local n,Plan As Dword                                                                                          <br />
ReDim amplitudearray(UBound(sinearray))                                                                                                                                                                                                <br />
<br />
n=UBound(sinearray)<br />
Plan= fftw_plan_dft_r2c_1d(n,  sinearray(0), amplitudearray(0), %FFTW_ESTIMATE )<br />
fftw_execute (Plan)<br />
fftw_destroy_plan(Plan)<br />
fftw_cleanup()</code></div></div>]]></description>
			<content:encoded><![CDATA[Dan, I saw your post on the pbusers.org site. I am not registered there.<br />
I have played with FFTW in the past. <br />
It was a long time ago though, so not sure if everything you need is here, but it might get you started.<br />
I could never make sense of the licencing for FFTW so moved to the Intel IPP, now OneAPI lib.<br />
It includes a lot of other useful functions, but it takes a while to get into it<br />
<br />
<br />
Here are my Declares:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>%FFTW_FORWARD =-1<br />
%FFTW_BACKWARD =1<br />
%FFTW_ESTIMATE =64  '(1U &lt;&lt; 6)  in c(rap)/c(razy) notation. IE bit 6 is set<br />
Enum R2RTransformKinds<br />
    HalfComplexDFT = 0<br />
    HalfComplexIDFT = 1<br />
    DHT = 2<br />
    DCT1 = 3<br />
    DCT2 = 5<br />
    DCT3 = 4<br />
    DCT4 = 6<br />
    DST1 = 7<br />
    DST2 = 9<br />
    DST3 = 8<br />
    DST4 = 10<br />
End Enum<br />
<br />
#If %DEF(%FFTW_Double)<br />
Type complex<br />
    real As Double<br />
    Imag As Double<br />
End Type<br />
<br />
<br />
Declare Function fftw_plan_dft Lib "libfftw3-3.dll" CDecl Alias "fftw_plan_dft" (ByVal DimCount As Long, ByRef DimSizes As Long, ByRef Src As Double, ByRef Dest As Double, ByVal Sign As Long, ByVal Flags As Long) As Long<br />
Declare Function fftw_plan_dft_1d Lib "libfftw3-3.dll" CDecl Alias "fftw_plan_dft_1d" (ByVal Dim1Size As Long, ByRef Src As Double, ByRef Dest As Double, ByVal Sign As Long, ByVal Flags As Long) As Long<br />
Declare Function fftw_plan_dft_2d Lib "libfftw3-3.dll" CDecl Alias "fftw_plan_dft_2d" (ByVal Dim1Size As Long, ByVal Dim2Size As Long, ByRef Src As Double, ByRef Dest As Double, ByVal Sign As Long, ByVal Flags As Long) As Long<br />
Declare Function fftw_plan_dft_3d Lib "libfftw3-3.dll" CDecl Alias "fftw_plan_dft_3d" (ByVal Dim1Size As Long, ByVal Dim2Size As Long, ByVal Dim3Size As Long, ByRef Src As Double, ByRef Dest As Double, ByVal Sign As Long, ByVal Flags As Long) As Long<br />
<br />
Declare Function fftw_plan_dft_r2c Lib "libfftw3-3.dll" CDecl Alias "fftw_plan_dft_r2c" (ByVal DimCount As Long, ByRef DimSizes As Long, ByRef Src As Double, ByRef Dest As Double, ByVal Flags As Long) As Long<br />
Declare Function fftw_plan_dft_r2c_1d Lib "libfftw3-3.dll" CDecl Alias "fftw_plan_dft_r2c_1d" (ByVal Dim1Size As Long, ByRef Src As Double, ByRef Dest As complex, ByVal Flags As Long) As Long<br />
Declare Function fftw_plan_dft_r2c_2d Lib "libfftw3-3.dll" CDecl Alias "fftw_plan_dft_r2c_2d" (ByVal Dim1Size As Long, ByVal Dim2Size As Long, ByRef Src As Double, ByRef Dest As Double, ByVal Flags As Long) As Long<br />
Declare Function fftw_plan_dft_r2c_3d Lib "libfftw3-3.dll" CDecl Alias "fftw_plan_dft_r2c_3d" (ByVal Dim1Size As Long, ByVal Dim2Size As Long, ByVal Dim3Size As Long, ByRef Src As Double, ByRef Dest As Double, ByVal Flags As Long) As Long<br />
<br />
Declare Function fftw_plan_dft_c2r Lib "libfftw3-3.dll" CDecl Alias "fftw_plan_dft_c2r" (ByVal DimCount As Long, ByRef DimSizes As Long, ByRef Src As Double, ByRef Dest As Double, ByVal Flags As Long) As Long<br />
Declare Function fftw_plan_dft_c2r_1d Lib "libfftw3-3.dll" CDecl Alias "fftw_plan_dft_c2r_1d" (ByVal Dim1Size As Long, ByRef Src As Double, ByRef Dest As Double, ByVal Flags As Long) As Long<br />
Declare Function fftw_plan_dft_c2r_2d Lib "libfftw3-3.dll" CDecl Alias "fftw_plan_dft_c2r_2d" (ByVal Dim1Size As Long, ByVal Dim2Size As Long, ByRef Src As Double, ByRef Dest As Double, ByVal Flags As Long) As Long<br />
Declare Function fftw_plan_dft_c2r_3d Lib "libfftw3-3.dll" CDecl Alias "fftw_plan_dft_c2r_3d" (ByVal Dim1Size As Long, ByVal Dim2Size As Long, ByVal Dim3Size As Long, ByRef Src As Double, ByRef Dest As Double, ByVal Flags As Long) As Long<br />
<br />
Declare Function fftw_plan_r2r Lib "libfftw3-3.dll" CDecl Alias "fftw_plan_r2r" (ByVal DimCount As Long, ByRef DimSizes As Long, ByRef Src As Double, ByRef Dest As Double, ByRef TransformKinds As Long, ByVal Flags As Long) As Long<br />
Declare Function fftw_plan_r2r_1d Lib "libfftw3-3.dll" CDecl Alias "fftw_plan_r2r_1d" (ByVal Dim1Size As Long, ByRef Src As Double, ByRef Dest As Double, ByVal Dim1TransformKind As Long, ByVal Flags As Long) As Long<br />
<br />
Declare Function fftw_plan_r2r_2d Lib "libfftw3-3.dll" CDecl Alias "fftw_plan_r2r_2d" (ByVal Dim1Size As Long, ByVal Dim2Size As Long, ByRef Src As Double, ByRef Dest As Double, _<br />
ByVal Dim1TransformKind As Long, ByVal Dim2TransformKind As Long, ByVal Flags As Long) As Long<br />
<br />
Declare Function fftw_plan_r2r_3d Lib "libfftw3-3.dll" CDecl Alias "fftw_plan_r2r_3d" (ByVal Dim1Size As Long, ByVal Dim2Size As Long, ByVal Dim3Size As Long, ByRef Src As Double, _<br />
ByRef Dest As Double, ByVal Dim1TransformKind As Long, ByVal Dim2TransformKind As Long, ByVal Dim3TransformKind As Long, ByVal Flags As Long) As Long<br />
<br />
Declare Sub fftw_execute Lib "libfftw3-3.dll" CDecl Alias "fftw_execute" (ByVal Plan As Long)<br />
Declare Sub fftw_execute_dft Lib "libfftw3-3.dll" CDecl Alias "fftw_execute_dft" (ByVal Plan As Long, ByRef Src As Double, ByRef Dest As Double)<br />
Declare Sub fftw_execute_dft_r2c Lib "libfftw3-3.dll" CDecl Alias "fftw_execute_dft_r2c" (ByVal Plan As Long, ByRef Src As Double, ByRef Dest As Double)<br />
Declare Sub fftw_execute_dft_c2r Lib "libfftw3-3.dll" CDecl Alias "fftw_execute_dft_c2r" (ByVal Plan As Long, ByRef Src As Double, ByRef Dest As Double)<br />
Declare Sub fftw_execute_r2r Lib "libfftw3-3.dll" CDecl Alias "fftw_execute_r2r" (ByVal Plan As Long, ByRef Src As Double, ByRef Dest As Double)<br />
<br />
Declare Sub fftw_destroy_plan Lib "libfftw3-3.dll" CDecl Alias "fftw_destroy_plan" (ByVal Plan As Long)<br />
Declare Sub fftw_cleanup Lib "libfftw3-3.dll" CDecl Alias "fftw_cleanup" ()<br />
#EndIf<br />
<br />
#If %DEF(%FFTW_Single)<br />
Type complex<br />
    real As Single<br />
    Imag As Single<br />
End Type<br />
<br />
                                    <br />
Declare Function fftw_plan_dft Lib "libfftw3f-3.dll" CDecl Alias "fftwf_plan_dft" (ByVal DimCount As Long, ByRef DimSizes As Long, ByRef Src As Single, ByRef Dest As Single, ByVal Sign As Long, ByVal Flags As Long) As Long<br />
Declare Function fftw_plan_dft_1d Lib "libfftw3f-3.dll" CDecl Alias "fftwf_plan_dft_1d" (ByVal Dim1Size As Long, ByRef Src As Single, ByRef Dest As Single, ByVal Sign As Long, ByVal Flags As Long) As Long<br />
Declare Function fftw_plan_dft_2d Lib "libfftw3f-3.dll" CDecl Alias "fftwf_plan_dft_2d" (ByVal Dim1Size As Long, ByVal Dim2Size As Long, ByRef Src As Single, ByRef Dest As Single, ByVal Sign As Long, ByVal Flags As Long) As Long<br />
Declare Function fftw_plan_dft_3d Lib "libfftw3f-3.dll" CDecl Alias "fftwf_plan_dft_3d" (ByVal Dim1Size As Long, ByVal Dim2Size As Long, ByVal Dim3Size As Long, ByRef Src As Single, ByRef Dest As Single, ByVal Sign As Long, ByVal Flags As Long) As Long<br />
<br />
Declare Function fftw_plan_dft_r2c Lib "libfftw3f-3.dll" CDecl Alias "fftwf_plan_dft_r2c" (ByVal DimCount As Long, ByRef DimSizes As Long, ByRef Src As Single, ByRef Dest As Single, ByVal Flags As Long) As Long<br />
Declare Function fftw_plan_dft_r2c_1d Lib "libfftw3f-3.dll" CDecl Alias "fftwf_plan_dft_r2c_1d" (ByVal Dim1Size As Long, ByRef Src As Single, ByRef Dest As complex, ByVal Flags As Long) As Long<br />
<br />
Declare Function fftw_plan_dft_r2c_2d Lib "libfftw3f-3.dll" CDecl Alias "fftwf_plan_dft_r2c_2d" (ByVal Dim1Size As Long, ByVal Dim2Size As Long, ByRef Src As Single, ByRef Dest As Single, ByVal Flags As Long) As Long<br />
Declare Function fftw_plan_dft_r2c_3d Lib "libfftw3f-3.dll" CDecl Alias "fftwf_plan_dft_r2c_3d" (ByVal Dim1Size As Long, ByVal Dim2Size As Long, ByVal Dim3Size As Long, ByRef Src As Single, ByRef Dest As Single, ByVal Flags As Long) As Long<br />
<br />
Declare Function fftw_plan_dft_c2r Lib "libfftw3f-3.dll" CDecl Alias "fftwf_plan_dft_c2r" (ByVal DimCount As Long, ByRef DimSizes As Long, ByRef Src As Single, ByRef Dest As Single, ByVal Flags As Long) As Long<br />
Declare Function fftw_plan_dft_c2r_1d Lib "libfftw3f-3.dll" CDecl Alias "fftwf_plan_dft_c2r_1d" (ByVal Dim1Size As Long, ByRef Src As Single, ByRef Dest As Single, ByVal Flags As Long) As Long<br />
Declare Function fftw_plan_dft_c2r_2d Lib "libfftw3f-3.dll" CDecl Alias "fftwf_plan_dft_c2r_2d" (ByVal Dim1Size As Long, ByVal Dim2Size As Long, ByRef Src As Single, ByRef Dest As Single, ByVal Flags As Long) As Long<br />
Declare Function fftw_plan_dft_c2r_3d Lib "libfftw3f-3.dll" CDecl Alias "fftwf_plan_dft_c2r_3d" (ByVal Dim1Size As Long, ByVal Dim2Size As Long, ByVal Dim3Size As Long, ByRef Src As Single, ByRef Dest As Single, ByVal Flags As Long) As Long<br />
<br />
Declare Function fftw_plan_r2r Lib "libfftw3f-3.dll" CDecl Alias "fftwf_plan_r2r" (ByVal DimCount As Long, ByRef DimSizes As Long, ByRef Src As Single, ByRef Dest As Single, ByRef TransformKinds As Long, ByVal Flags As Long) As Long<br />
Declare Function fftw_plan_r2r_1d Lib "libfftw3f-3.dll" CDecl Alias "fftwf_plan_r2r_1d" (ByVal Dim1Size As Long, ByRef Src As Single, ByRef Dest As Single, ByVal Dim1TransformKind As Long, ByVal Flags As Long) As Long<br />
<br />
Declare Function fftw_plan_r2r_2d Lib "libfftw3f-3.dll" CDecl Alias "fftwf_plan_r2r_2d" (ByVal Dim1Size As Long, ByVal Dim2Size As Long, ByRef Src As Single, ByRef Dest As Single, _<br />
ByVal Dim1TransformKind As Long, ByVal Dim2TransformKind As Long, ByVal Flags As Long) As Long<br />
<br />
Declare Function fftw_plan_r2r_3d Lib "libfftw3f-3.dll" CDecl Alias "fftwf_plan_r2r_3d" (ByVal Dim1Size As Long, ByVal Dim2Size As Long, ByVal Dim3Size As Long, ByRef Src As Single, _<br />
ByRef Dest As Single, ByVal Dim1TransformKind As Long, ByVal Dim2TransformKind As Long, ByVal Dim3TransformKind As Long, ByVal Flags As Long) As Long<br />
<br />
Declare Sub fftw_execute Lib "libfftw3f-3.dll" CDecl Alias "fftwf_execute" (ByVal Plan As Long)<br />
Declare Sub fftw_execute_dft Lib "libfftw3f-3.dll" CDecl Alias "fftwf_execute_dft" (ByVal Plan As Long, ByRef Src As Single, ByRef Dest As Single)<br />
Declare Sub fftw_execute_dft_r2c Lib "libfftw3f-3.dll" CDecl Alias "fftwf_execute_dft_r2c" (ByVal Plan As Long, ByRef Src As Single, ByRef Dest As Single)<br />
Declare Sub fftw_execute_dft_c2r Lib "libfftw3f-3.dll" CDecl Alias "fftwf_execute_dft_c2r" (ByVal Plan As Long, ByRef Src As Single, ByRef Dest As Single)<br />
Declare Sub fftw_execute_r2r Lib "libfftw3f-3.dll" CDecl Alias "fftwf_execute_r2r" (ByVal Plan As Long, ByRef Src As Single, ByRef Dest As Single)<br />
<br />
Declare Sub fftw_destroy_plan Lib "libfftw3f-3.dll" CDecl Alias "fftwf_destroy_plan" (ByVal Plan As Long)<br />
Declare Sub fftw_cleanup Lib "libfftw3f-3.dll" CDecl Alias "fftwf_cleanup" ()<br />
#EndIf<br />
<br />
<br />
<br />
And this is how I used it (sinearray is as it suggests an array of samples containing a sinwave):<br />
<br />
Local n,Plan As Dword                                                                                          <br />
ReDim amplitudearray(UBound(sinearray))                                                                                                                                                                                                <br />
<br />
n=UBound(sinearray)<br />
Plan= fftw_plan_dft_r2c_1d(n,  sinearray(0), amplitudearray(0), %FFTW_ESTIMATE )<br />
fftw_execute (Plan)<br />
fftw_destroy_plan(Plan)<br />
fftw_cleanup()</code></div></div>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Enter PIN popup dialog in DLL.]]></title>
			<link>https://pump.richheimer.de/showthread.php?tid=128</link>
			<pubDate>Thu, 23 Apr 2026 14:54:46 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://pump.richheimer.de/member.php?action=profile&uid=23">Dale Yarker</a>]]></dc:creator>
			<guid isPermaLink="false">https://pump.richheimer.de/showthread.php?tid=128</guid>
			<description><![CDATA[A popup for user to enter a PIN for return to your app. The number of digits is specified in the call, and checked by the function in the DLL.<br />
<br />
Longer description<br />
at <a href="https://www.yarker-dsyc.info/Programs/Misc/PIN/Enter_PIN_DLL.html" target="_blank" rel="noopener" class="mycode_url">https://www.yarker-dsyc.info/Programs/Mi...N_DLL.html</a><br />
<br />
Source, compiled, icons and Help file in ZIP<br />
at <a href="https://www.yarker-dsyc.info/Programs/Misc/PIN/Enter_PIN.zip" target="_blank" rel="noopener" class="mycode_url">https://www.yarker-dsyc.info/Programs/Mi...er_PIN.zip</a><br />
<br />
DLL source: <br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#compile dll<br />
#dim all<br />
'================================================================<br />
enum PIN_IDs singular<br />
  '%en_update group<br />
  ID_PINA1Txtbx = &amp;h3000&amp;<br />
  ID_PINA2Txtbx<br />
  ID_PINA3Txtbx<br />
  ID_PINA4Txtbx<br />
  ID_PINA5Txtbx<br />
  ID_PINA6Txtbx<br />
  ID_PINA7Txtbx<br />
  ID_PINA8Txtbx<br />
  ID_PINA9Txtbx<br />
  ID_PINB1Txtbx = &amp;h3010<br />
  ID_PINB2Txtbx<br />
  ID_PINB3Txtbx<br />
  ID_PINB4Txtbx<br />
  ID_PINB5Txtbx<br />
  ID_PINB6Txtbx<br />
  ID_PINB7Txtbx<br />
  ID_PINB8Txtbx<br />
  ID_PINB9Txtbx<br />
  '%bn_clicked group<br />
  ID_PINAExposeBtn<br />
  ID_PINBExposeBtn<br />
  ID_PINSubmitSnglBtn<br />
  ID_PINSubmitDuplBtn<br />
  ID_PINHelp<br />
  ID_PINCanx<br />
  'not selected in callback<br />
  ID_PINInstruLbl<br />
  ID_PINALbl<br />
  ID_PINBLbl                                    'type rect '<br />
end enum 'number up to &amp;h3FF reserved<br />
'<br />
%EM_SETPASSWORDCHAR = &amp;h00CC<br />
%wm_syscommand = &amp;h0112 '(not built into PBWin)<br />
%DT_CalcRect = &amp;h00000400<br />
#resource icon, PIN16, ".&#92;PIN16.ico"<br />
#resource icon, ShowPWon24, ".&#92;ShowPWon24.ico"<br />
#resource icon, ShowPWoff24, ".&#92;ShowPWoff24.ico"<br />
#resource icon, PINSubmit, ".&#92;PINSubmit48.ico"<br />
#resource icon, PINHelp, ".&#92;HelpQuesBtn48.ico"<br />
#resource icon, PINCanx, ".&#92;CancelPIN32.ico"<br />
global gIsVariableDigits, gNumOfDigits as long '(is in PIN_Enter and callback)<br />
global gEntryErrTitle as wstring<br />
declare function ShellExecute lib "Shell32.dll" alias "ShellExecuteW" ( _<br />
    byval hwnd as dword, lpOperation as wstringz, lpFile as wstringz, _<br />
    lpParameters as wstringz, lpDirectory as wstringz, byval nShowCmd as long) _<br />
    as dword<br />
<br />
'############################################################# the function ####<br />
function PIN_Enter alias "PIN_Enter" (byval hParent as dword, _<br />
                                      byval DualPIN as long, _<br />
                                      byval NumOfDigits as long) export as dword<br />
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<br />
  static Not1stCall, nFontMono14B as long<br />
  static gEntryErrTitle as wstring<br />
  static RatioX, RatioY as single<br />
  local hPIN_Dlg, PIN as dword<br />
  local TBY, TBX, ID_Dig, PosX as long<br />
  local InstruStr, DigCnt as wstring<br />
  '========================================================= initialization ====<br />
  '····························································· persistent ····<br />
  if Not1stCall = 0 then 'so it is first call<br />
    Not1stCall = -1<br />
    font new "Lucida Console", 14, 1, 1, 0, 0 to nFontMono14B<br />
    dialog default font "Segoe UI", 12, 0, 1<br />
    gEntryErrTitle = "PIN Entry Error"&#36;&#36;<br />
  end if<br />
  '······························································ each call ····<br />
  if (NumOfDigits &lt; 0) or (NumOfDigits &gt; 9) then 'check range<br />
    msgbox "The number of PIN digits can only be optionally"&#36;&#36; + &#36;&#36;crlf + _<br />
         &nbsp;&nbsp;"not used, or 0 to 9 digits long."&#36;&#36; + &#36;&#36;crlf + _<br />
         &nbsp;&nbsp;"Not used or 0 is for a variable length PIN of"&#36;&#36; + &#36;&#36;crlf + _<br />
         &nbsp;&nbsp;"1 to 9 digigits. Otherwise the number of digits is"&#36;&#36; + &#36;&#36;crlf + _<br />
         &nbsp;&nbsp;"fixed by the using program."&#36;&#36;, _<br />
         &nbsp;&nbsp;%mb_ok or %mb_iconerror or %mb_taskmodal, gEntryErrTitle<br />
    exit function<br />
  end if<br />
  if NumOfDigits = 0 then 'variable number<br />
    gIsVariableDigits = -1<br />
    gNumOfDigits = 9<br />
  else<br />
    gNumOfDigits = NumOfDigits<br />
  end if<br />
  '================================================================= dialog ====<br />
  dialog new hParent, "Enter PIN."&#36;&#36;, _<br />
      0, 10, 200, 120, _<br />
   &nbsp;&nbsp;%ds_3dlook or %ds_modalframe or %ds_nofailcreate or %ds_setfont or _<br />
   &nbsp;&nbsp;%ws_caption or %ws_clipsiblings or %ws_dlgframe or %ws_popup or _<br />
   &nbsp;&nbsp;%ws_sysmenu, %ws_ex_left or %ws_ex_ltrreading to hPIN_Dlg<br />
  dialog set icon hPIN_Dlg, "PIN16"<br />
  '------------------------------------------------------- unit/pixel ratio ----<br />
  #if %pb_revision = &amp;h1004<br />
    dialog units hPIN_Dlg, 1000, 1000 to pixels TBY, TBX 'precycle longs<br />
  #else<br />
    dialog units hPIN_Dlg, 1000, 1000 to pixels TBX, TBY<br />
  #endif<br />
  RatioX = 1000 /TBX : RatioY =  1000 / TBY 'mult img px for button units<br />
  '------------------------------------------------------------- PIN instru ----<br />
  if DualPIN then<br />
    InstruStr = "The application requires dual entry for the requested "&#36;&#36; + _<br />
                "task. "&#36;&#36;<br />
  end if<br />
  if NumOfDigits then<br />
    InstruStr +="Enter the "&#36;&#36; + dec&#36;(gNumOfDigits) + " digit PIN. "&#36;&#36;<br />
  else<br />
    InstruStr += "The number of digits is not fixed. The PIN may be 4 "&#36;&#36; + _<br />
               &nbsp;&nbsp;"to 9 digits. Leave unused digits at right empty. "&#36;&#36;<br />
  end if<br />
  InstruStr += "The only characters allowed are ""0"" to ""9""."&#36;&#36;<br />
  control add label, hPIN_Dlg, %ID_PINInstruLbl, InstruStr,  _<br />
   &nbsp;&nbsp;5, 4, 185, 34, %ss_left, %ws_ex_left<br />
  control set color hPIN_Dlg, %ID_PINInstruLbl, -1, &amp;hFAFAFA<br />
  '---------------------------------------------------- "A" digit textboxes ----<br />
  control add label, hPIN_Dlg, %ID_PINALbl, "Enter PIN:"&#36;&#36;, _<br />
   &nbsp;&nbsp;4, 45, 42, 10, %ss_right, %ws_ex_left &nbsp;&nbsp;''55<br />
  '<br />
  PosX = 49<br />
  for ID_Dig = %ID_PINA1Txtbx to %ID_PINA1Txtbx + gNumOfDigits - 1<br />
    control add textbox, hPIN_Dlg, ID_Dig, ""&#36;&#36;, _<br />
     &nbsp;&nbsp;PosX, 44, 12, 10, %es_center or %es_number or %ws_border or _<br />
     &nbsp;&nbsp;%ws_tabstop or %es_password, %ws_ex_clientedge or %ws_ex_left<br />
    control set font hPIN_Dlg, ID_Dig, nFontMono14B<br />
    PosX += 15<br />
  next<br />
  '<br />
  control add imgbutton, hPIN_Dlg, %ID_PINAExposeBtn, "ShowPWon24", _<br />
   &nbsp;&nbsp;181, 43, 28 * RatioX, 28 * RatioY<br />
  if DualPIN = 0 then<br />
    control add imgbutton, hPIN_Dlg, %ID_PINSubmitSnglBtn, "PINSubmit", _<br />
     &nbsp;&nbsp;49 - (52 * RatioX), 59, 52 * RatioX, 52 * RatioY<br />
 &nbsp;&nbsp;' dialog set size hPIN_Dlg, 200, 75 + (52 * RatioY)<br />
  else<br />
  '---------------------------------------------------- "B" digit textboxes ----<br />
    PosX = 49<br />
    control add label, hPIN_Dlg, %ID_PINBLbl, "Reenter PIN:"&#36;&#36;, _<br />
     &nbsp;&nbsp;4, 60, 42, 10, %ss_right, %ws_ex_left &nbsp;&nbsp;''55<br />
    for ID_Dig = %ID_PINB1Txtbx to %ID_PINB1Txtbx + gNumOfDigits - 1<br />
      control add textbox, hPIN_Dlg, ID_Dig, ""&#36;&#36;, _<br />
       &nbsp;&nbsp;PosX, 60, 12, 10, %es_center or %es_number or %ws_border or _<br />
       &nbsp;&nbsp;%ws_tabstop or %es_password, %ws_ex_clientedge or %ws_ex_left<br />
      control set font hPIN_Dlg, ID_Dig, nFontMono14B<br />
      PosX += 15<br />
    next<br />
  '<br />
    control add imgbutton, hPIN_Dlg, %ID_PINBExposeBtn, "ShowPWon24", _<br />
     &nbsp;&nbsp;181, 59, 28 * RatioX, 28 * RatioY<br />
    control add imgbutton, hPIN_Dlg, %ID_PINSubmitDuplBtn, "PINSubmit", _<br />
     &nbsp;&nbsp;49 - (52 * RatioX), 75, 52 * RatioX, 52 * RatioY<br />
  end if<br />
  '----------------------------------------------------- "A" and "B" common ----<br />
  if DualPIN = 0 then<br />
    control add imgbutton, hPIN_Dlg, %ID_PINHelp, "PINHelp", _<br />
     &nbsp;&nbsp;191 - (99 * RatioX), 59, 52 * RatioX, 52 * RatioY<br />
    control add imgbutton, hPIN_Dlg, %ID_PINCanx, "PINCanx", _<br />
     &nbsp;&nbsp;191 - (36 * RatioX), 59 + (16 * RatioY), (36 * RatioX), (36 * RatioY)<br />
    dialog set size hPIN_Dlg, 200, 76 + (52 * RatioY)<br />
  else<br />
    control add imgbutton, hPIN_Dlg, %ID_PINHelp, "PINHelp", _<br />
     &nbsp;&nbsp;191 - (99 * RatioX), 75, 52 * RatioX, 52 * RatioY<br />
<br />
    dialog set size hPIN_Dlg, 200, 92 + (52 * RatioY)<br />
    control add imgbutton, hPIN_Dlg, %ID_PINCanx, "PINCanx", _<br />
     &nbsp;&nbsp;191 - (36 * RatioX), 75 + (16 * RatioY), (36 * RatioX), (36 * RatioY)<br />
  end if<br />
  '<br />
  dialog show modal hPIN_Dlg call  PINDlgCB to PIN<br />
  function = PIN<br />
end function<br />
'================================================================= callback ====<br />
callback function PINDlgCB() as long<br />
  static A_IsExposed, B_IsExposed as long<br />
  static PINStr as wstring<br />
  local TmpL as long<br />
  local TmpS as wstring<br />
  if cb.msg = %wm_command then<br />
    if cb.ctlmsg = %en_update then<br />
      if (cb.ctl &gt;= %ID_PINA1Txtbx) and (cb.ctl &lt;= %ID_PINB9Txtbx) then<br />
        if (gNumOfDigits - 1) &gt; (&amp;h00000F and cb.ctl) then<br />
          control set focus cb.hndl, cb.ctl + 1<br />
        else<br />
          control set focus cb.hndl, %ID_PINB1Txtbx<br />
        end if<br />
      end if<br />
    elseif cb.ctlmsg = %bn_clicked then<br />
      select case as const cb.ctl<br />
        case %ID_PINAExposeBtn<br />
          if A_IsExposed then 'unexpose<br />
            for TmpL = %ID_PINA1Txtbx to %ID_PINA9Txtbx<br />
              control send cb.hndl, TmpL, %EM_SETPASSWORDCHAR,_<br />
               &nbsp;&nbsp;&amp;h2A, 0<br />
            next<br />
            control set imgbutton cb.hndl, %ID_PINAExposeBtn, "ShowPWon24"<br />
            A_IsExposed = 0<br />
          else 'expose<br />
            for TmpL = %ID_PINA1Txtbx to %ID_PINA9Txtbx<br />
              control send cb.hndl, TmpL, %EM_SETPASSWORDCHAR, 0, 0<br />
            next<br />
            control set imgbutton cb.hndl, %ID_PINAExposeBtn, "ShowPWoff24"<br />
            A_IsExposed = -1<br />
          end if<br />
          for TmpL = %ID_PINA1Txtbx to %ID_PINA9Txtbx<br />
            control redraw cb.hndl, TmpL<br />
          next<br />
        case %ID_PINBExposeBtn<br />
          if B_IsExposed then<br />
            for TmpL = %ID_PINB1Txtbx to %ID_PINB9Txtbx<br />
              control send cb.hndl, TmpL, %EM_SETPASSWORDCHAR,_<br />
               &nbsp;&nbsp;&amp;h2A, 0<br />
            next<br />
            control set imgbutton cb.hndl, %ID_PINBExposeBtn, "ShowPWon24"<br />
            B_IsExposed = 0<br />
          else 'expose<br />
            for TmpL = %ID_PINB1Txtbx to %ID_PINB9Txtbx<br />
              control send cb.hndl, TmpL, %EM_SETPASSWORDCHAR, 0, 0<br />
            next<br />
            control set imgbutton cb.hndl, %ID_PINBExposeBtn, "ShowPWoff24"<br />
            B_IsExposed = -1<br />
          end if<br />
          for TmpL = %ID_PINB1Txtbx to %ID_PINB9Txtbx<br />
            control redraw cb.hndl, TmpL<br />
          next<br />
        '············································· submit single button ····<br />
        case %ID_PINSubmitSnglBtn, %ID_PINSubmitDuplBtn<br />
          control get text cb.hndl, %ID_PINA1Txtbx to TmpS<br />
          PINStr = TmpS<br />
          for TmpL = 1 to 8<br />
            control get text cb.hndl, %ID_PINA1Txtbx + TmpL to TmpS<br />
            PINStr += TmpS<br />
          next<br />
          TmpL = len(PINStr)<br />
          if gIsVariableDigits then<br />
            if Tmpl &lt; 4 then<br />
              msgbox "Varible length PINs must be 4 to 9 digits "&#36;&#36; + _<br />
                   &nbsp;&nbsp;"and exactly the same as when it was created."&#36;&#36;, _<br />
                   &nbsp;&nbsp;%mb_ok or %mb_iconerror or %mb_taskmodal, gEntryErrTitle<br />
              exit function<br />
            end if<br />
          else<br />
            if TmpL &lt; gNumOfDigits then<br />
              msgbox "The program using this PIN requires "&#36;&#36; + _<br />
                   &nbsp;&nbsp;dec&#36;(gNumOfDigits) + " digits."&#36;&#36;, _<br />
                   &nbsp;&nbsp;%mb_ok or %mb_iconerror or %mb_taskmodal, gEntryErrTitle<br />
              exit function<br />
            end if<br />
          end if<br />
          if cb.ctl = %ID_PINSubmitDuplBtn then<br />
            for TmpL = 0 to 8<br />
              control get text cb.hndl, %ID_PINB1Txtbx + TmpL to TmpS<br />
                if TmpS = mid&#36;(PINStr, TmpL + 1, 1) then<br />
                  iterate for<br />
                else<br />
                  msgbox "The and the repeat do not match."&#36;&#36;, _<br />
                       &nbsp;&nbsp;%mb_ok or %mb_iconerror or %mb_taskmodal, _<br />
                       &nbsp;&nbsp;gEntryErrTitle<br />
                  exit function<br />
                end if<br />
              next<br />
          end if<br />
          if gIsVariableDigits then<br />
            TmpL = 9 - len(PINStr)<br />
            PINStr += string&#36;&#36;(TmpL, "0"&#36;&#36;)<br />
          end if<br />
          dialog end cb.hndl, val(PINStr)<br />
        case %ID_PINHelp<br />
       &nbsp;&nbsp;'' ShellExecute<br />
            ShellExecute (0, "open"&#36;&#36;, "PIN_Enter_Help.html", ""&#36;&#36;, ""&#36;&#36;, %sw_shownormal)<br />
        case %ID_PINCanx<br />
          goto NoPIN<br />
      end select<br />
    end if<br />
  elseif (lo(word, cb.wparam) = %sc_close) and (cb.msg = %wm_syscommand) then<br />
    goto NoPIN<br />
  end if<br />
  exit function<br />
  NoPIN:<br />
  TmpL = msgbox("""Yes"", to quit PIN entry."&#36;&#36; + &#36;&#36;crlf + _<br />
                """No"", to stay and enter a PIN."&#36;&#36;, _<br />
            %mb_yesno or %mb_iconquestion or %mb_defbutton2 or %mb_taskmodal, _<br />
            "Verify Quitting PIN Entry"&#36;&#36;)<br />
  if TmpL = %idno then<br />
    function = -1<br />
  else<br />
    dialog end cb.hndl<br />
  end if<br />
end function</code></div></div>Demo source: <br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>'File PIN_SLL_demo.bas<br />
#compile exe<br />
#dim all<br />
#if %def(%pb_cc32)<br />
  #console off<br />
#endif<br />
declare function PIN_Enter lib "EnterPIN.dll" alias "PIN_Enter" _<br />
                                            (byval hParent as dword, _<br />
                                           &nbsp;&nbsp;byval DuplPIN as long, _<br />
                                           &nbsp;&nbsp;byval NumOfDigits as long) as dword<br />
function pbmain () as long<br />
  local hTWin, PIN as dword<br />
  local Rspnc as wstring<br />
  txt.window("PIN Enter Popup Demonstration"&#36;&#36;, 400, 70, 20, 75) to hTWin<br />
  txt.color = %rgb_green<br />
  txt.print "At any wait use any key to continue. (like now :) )"&#36;&#36;<br />
  txt.waitkey&#36;<br />
  '<br />
  txt.color = %rgb_blue<br />
  txt.print "A dual PIN entry with number of digits set to 4. "&#36;&#36;;<br />
  txt.color = %rgb_black<br />
  txt.print "Returned PIN is: "&#36;&#36; + dec&#36;(PIN_Enter(hTWin, 1, 4), 4)"."&#36;&#36;<br />
  txt.color = %rgb_green<br />
  txt.print<br />
  txt.print "Any key to continue."<br />
  txt.waitkey&#36;<br />
  '<br />
  txt.color = %rgb_blue<br />
  txt.print "A single PIN entry with number of digits set to 4. "&#36;&#36;;<br />
  txt.color = %rgb_black<br />
  txt.print "Returned PIN is: "&#36;&#36; + dec&#36;(PIN_Enter(hTWin, 0, 4), 4)"."&#36;&#36;<br />
  txt.print<br />
  txt.color = %rgb_green<br />
  txt.print """ESC"" to end demo, any other key to continue with next."<br />
  Rspnc = txt.waitkey&#36;<br />
  if Rspnc = &#36;&#36;esc then exit function<br />
  '<br />
  txt.color = %rgb_blue<br />
  txt.print "Number of PIN digits set to 9. "&#36;&#36;;<br />
  txt.color = %rgb_black<br />
  txt.print "Returned PIN is: "&#36;&#36; + dec&#36;(PIN_Enter(hTWin, 0, 9), 9)"."&#36;&#36;<br />
  txt.color = %rgb_blue<br />
  txt.print "You had to enter 9 digits, or ""Cancel PIN"" to get here."&#36;&#36;<br />
  txt.print<br />
  txt.color = %rgb_green<br />
  txt.print """ESC"" to end demo, any other key to continue with next."<br />
  Rspnc = txt.waitkey&#36;<br />
  if Rspnc = &#36;&#36;esc then exit function<br />
  txt.color = %rgb_blue<br />
  txt.print "Number of PIN digits set to 0 (user preference). "&#36;&#36;<br />
  txt.print "Looks like previous, but 4 to 9 digits allowed."&#36;&#36;;<br />
  txt.print "Returned PIN is: "&#36;&#36; + dec&#36;(PIN_Enter(hTWin, 0, 0), 9)"."&#36;&#36;<br />
  '<br />
<br />
  '---------------------------------------------------------------------<br />
  txt.color = %rgb_green<br />
  txt.print<br />
  txt.print "Any key will close."&#36;&#36;<br />
  txt.waitkey&#36;<br />
end function</code></div></div>]]></description>
			<content:encoded><![CDATA[A popup for user to enter a PIN for return to your app. The number of digits is specified in the call, and checked by the function in the DLL.<br />
<br />
Longer description<br />
at <a href="https://www.yarker-dsyc.info/Programs/Misc/PIN/Enter_PIN_DLL.html" target="_blank" rel="noopener" class="mycode_url">https://www.yarker-dsyc.info/Programs/Mi...N_DLL.html</a><br />
<br />
Source, compiled, icons and Help file in ZIP<br />
at <a href="https://www.yarker-dsyc.info/Programs/Misc/PIN/Enter_PIN.zip" target="_blank" rel="noopener" class="mycode_url">https://www.yarker-dsyc.info/Programs/Mi...er_PIN.zip</a><br />
<br />
DLL source: <br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#compile dll<br />
#dim all<br />
'================================================================<br />
enum PIN_IDs singular<br />
  '%en_update group<br />
  ID_PINA1Txtbx = &amp;h3000&amp;<br />
  ID_PINA2Txtbx<br />
  ID_PINA3Txtbx<br />
  ID_PINA4Txtbx<br />
  ID_PINA5Txtbx<br />
  ID_PINA6Txtbx<br />
  ID_PINA7Txtbx<br />
  ID_PINA8Txtbx<br />
  ID_PINA9Txtbx<br />
  ID_PINB1Txtbx = &amp;h3010<br />
  ID_PINB2Txtbx<br />
  ID_PINB3Txtbx<br />
  ID_PINB4Txtbx<br />
  ID_PINB5Txtbx<br />
  ID_PINB6Txtbx<br />
  ID_PINB7Txtbx<br />
  ID_PINB8Txtbx<br />
  ID_PINB9Txtbx<br />
  '%bn_clicked group<br />
  ID_PINAExposeBtn<br />
  ID_PINBExposeBtn<br />
  ID_PINSubmitSnglBtn<br />
  ID_PINSubmitDuplBtn<br />
  ID_PINHelp<br />
  ID_PINCanx<br />
  'not selected in callback<br />
  ID_PINInstruLbl<br />
  ID_PINALbl<br />
  ID_PINBLbl                                    'type rect '<br />
end enum 'number up to &amp;h3FF reserved<br />
'<br />
%EM_SETPASSWORDCHAR = &amp;h00CC<br />
%wm_syscommand = &amp;h0112 '(not built into PBWin)<br />
%DT_CalcRect = &amp;h00000400<br />
#resource icon, PIN16, ".&#92;PIN16.ico"<br />
#resource icon, ShowPWon24, ".&#92;ShowPWon24.ico"<br />
#resource icon, ShowPWoff24, ".&#92;ShowPWoff24.ico"<br />
#resource icon, PINSubmit, ".&#92;PINSubmit48.ico"<br />
#resource icon, PINHelp, ".&#92;HelpQuesBtn48.ico"<br />
#resource icon, PINCanx, ".&#92;CancelPIN32.ico"<br />
global gIsVariableDigits, gNumOfDigits as long '(is in PIN_Enter and callback)<br />
global gEntryErrTitle as wstring<br />
declare function ShellExecute lib "Shell32.dll" alias "ShellExecuteW" ( _<br />
    byval hwnd as dword, lpOperation as wstringz, lpFile as wstringz, _<br />
    lpParameters as wstringz, lpDirectory as wstringz, byval nShowCmd as long) _<br />
    as dword<br />
<br />
'############################################################# the function ####<br />
function PIN_Enter alias "PIN_Enter" (byval hParent as dword, _<br />
                                      byval DualPIN as long, _<br />
                                      byval NumOfDigits as long) export as dword<br />
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<br />
  static Not1stCall, nFontMono14B as long<br />
  static gEntryErrTitle as wstring<br />
  static RatioX, RatioY as single<br />
  local hPIN_Dlg, PIN as dword<br />
  local TBY, TBX, ID_Dig, PosX as long<br />
  local InstruStr, DigCnt as wstring<br />
  '========================================================= initialization ====<br />
  '····························································· persistent ····<br />
  if Not1stCall = 0 then 'so it is first call<br />
    Not1stCall = -1<br />
    font new "Lucida Console", 14, 1, 1, 0, 0 to nFontMono14B<br />
    dialog default font "Segoe UI", 12, 0, 1<br />
    gEntryErrTitle = "PIN Entry Error"&#36;&#36;<br />
  end if<br />
  '······························································ each call ····<br />
  if (NumOfDigits &lt; 0) or (NumOfDigits &gt; 9) then 'check range<br />
    msgbox "The number of PIN digits can only be optionally"&#36;&#36; + &#36;&#36;crlf + _<br />
         &nbsp;&nbsp;"not used, or 0 to 9 digits long."&#36;&#36; + &#36;&#36;crlf + _<br />
         &nbsp;&nbsp;"Not used or 0 is for a variable length PIN of"&#36;&#36; + &#36;&#36;crlf + _<br />
         &nbsp;&nbsp;"1 to 9 digigits. Otherwise the number of digits is"&#36;&#36; + &#36;&#36;crlf + _<br />
         &nbsp;&nbsp;"fixed by the using program."&#36;&#36;, _<br />
         &nbsp;&nbsp;%mb_ok or %mb_iconerror or %mb_taskmodal, gEntryErrTitle<br />
    exit function<br />
  end if<br />
  if NumOfDigits = 0 then 'variable number<br />
    gIsVariableDigits = -1<br />
    gNumOfDigits = 9<br />
  else<br />
    gNumOfDigits = NumOfDigits<br />
  end if<br />
  '================================================================= dialog ====<br />
  dialog new hParent, "Enter PIN."&#36;&#36;, _<br />
      0, 10, 200, 120, _<br />
   &nbsp;&nbsp;%ds_3dlook or %ds_modalframe or %ds_nofailcreate or %ds_setfont or _<br />
   &nbsp;&nbsp;%ws_caption or %ws_clipsiblings or %ws_dlgframe or %ws_popup or _<br />
   &nbsp;&nbsp;%ws_sysmenu, %ws_ex_left or %ws_ex_ltrreading to hPIN_Dlg<br />
  dialog set icon hPIN_Dlg, "PIN16"<br />
  '------------------------------------------------------- unit/pixel ratio ----<br />
  #if %pb_revision = &amp;h1004<br />
    dialog units hPIN_Dlg, 1000, 1000 to pixels TBY, TBX 'precycle longs<br />
  #else<br />
    dialog units hPIN_Dlg, 1000, 1000 to pixels TBX, TBY<br />
  #endif<br />
  RatioX = 1000 /TBX : RatioY =  1000 / TBY 'mult img px for button units<br />
  '------------------------------------------------------------- PIN instru ----<br />
  if DualPIN then<br />
    InstruStr = "The application requires dual entry for the requested "&#36;&#36; + _<br />
                "task. "&#36;&#36;<br />
  end if<br />
  if NumOfDigits then<br />
    InstruStr +="Enter the "&#36;&#36; + dec&#36;(gNumOfDigits) + " digit PIN. "&#36;&#36;<br />
  else<br />
    InstruStr += "The number of digits is not fixed. The PIN may be 4 "&#36;&#36; + _<br />
               &nbsp;&nbsp;"to 9 digits. Leave unused digits at right empty. "&#36;&#36;<br />
  end if<br />
  InstruStr += "The only characters allowed are ""0"" to ""9""."&#36;&#36;<br />
  control add label, hPIN_Dlg, %ID_PINInstruLbl, InstruStr,  _<br />
   &nbsp;&nbsp;5, 4, 185, 34, %ss_left, %ws_ex_left<br />
  control set color hPIN_Dlg, %ID_PINInstruLbl, -1, &amp;hFAFAFA<br />
  '---------------------------------------------------- "A" digit textboxes ----<br />
  control add label, hPIN_Dlg, %ID_PINALbl, "Enter PIN:"&#36;&#36;, _<br />
   &nbsp;&nbsp;4, 45, 42, 10, %ss_right, %ws_ex_left &nbsp;&nbsp;''55<br />
  '<br />
  PosX = 49<br />
  for ID_Dig = %ID_PINA1Txtbx to %ID_PINA1Txtbx + gNumOfDigits - 1<br />
    control add textbox, hPIN_Dlg, ID_Dig, ""&#36;&#36;, _<br />
     &nbsp;&nbsp;PosX, 44, 12, 10, %es_center or %es_number or %ws_border or _<br />
     &nbsp;&nbsp;%ws_tabstop or %es_password, %ws_ex_clientedge or %ws_ex_left<br />
    control set font hPIN_Dlg, ID_Dig, nFontMono14B<br />
    PosX += 15<br />
  next<br />
  '<br />
  control add imgbutton, hPIN_Dlg, %ID_PINAExposeBtn, "ShowPWon24", _<br />
   &nbsp;&nbsp;181, 43, 28 * RatioX, 28 * RatioY<br />
  if DualPIN = 0 then<br />
    control add imgbutton, hPIN_Dlg, %ID_PINSubmitSnglBtn, "PINSubmit", _<br />
     &nbsp;&nbsp;49 - (52 * RatioX), 59, 52 * RatioX, 52 * RatioY<br />
 &nbsp;&nbsp;' dialog set size hPIN_Dlg, 200, 75 + (52 * RatioY)<br />
  else<br />
  '---------------------------------------------------- "B" digit textboxes ----<br />
    PosX = 49<br />
    control add label, hPIN_Dlg, %ID_PINBLbl, "Reenter PIN:"&#36;&#36;, _<br />
     &nbsp;&nbsp;4, 60, 42, 10, %ss_right, %ws_ex_left &nbsp;&nbsp;''55<br />
    for ID_Dig = %ID_PINB1Txtbx to %ID_PINB1Txtbx + gNumOfDigits - 1<br />
      control add textbox, hPIN_Dlg, ID_Dig, ""&#36;&#36;, _<br />
       &nbsp;&nbsp;PosX, 60, 12, 10, %es_center or %es_number or %ws_border or _<br />
       &nbsp;&nbsp;%ws_tabstop or %es_password, %ws_ex_clientedge or %ws_ex_left<br />
      control set font hPIN_Dlg, ID_Dig, nFontMono14B<br />
      PosX += 15<br />
    next<br />
  '<br />
    control add imgbutton, hPIN_Dlg, %ID_PINBExposeBtn, "ShowPWon24", _<br />
     &nbsp;&nbsp;181, 59, 28 * RatioX, 28 * RatioY<br />
    control add imgbutton, hPIN_Dlg, %ID_PINSubmitDuplBtn, "PINSubmit", _<br />
     &nbsp;&nbsp;49 - (52 * RatioX), 75, 52 * RatioX, 52 * RatioY<br />
  end if<br />
  '----------------------------------------------------- "A" and "B" common ----<br />
  if DualPIN = 0 then<br />
    control add imgbutton, hPIN_Dlg, %ID_PINHelp, "PINHelp", _<br />
     &nbsp;&nbsp;191 - (99 * RatioX), 59, 52 * RatioX, 52 * RatioY<br />
    control add imgbutton, hPIN_Dlg, %ID_PINCanx, "PINCanx", _<br />
     &nbsp;&nbsp;191 - (36 * RatioX), 59 + (16 * RatioY), (36 * RatioX), (36 * RatioY)<br />
    dialog set size hPIN_Dlg, 200, 76 + (52 * RatioY)<br />
  else<br />
    control add imgbutton, hPIN_Dlg, %ID_PINHelp, "PINHelp", _<br />
     &nbsp;&nbsp;191 - (99 * RatioX), 75, 52 * RatioX, 52 * RatioY<br />
<br />
    dialog set size hPIN_Dlg, 200, 92 + (52 * RatioY)<br />
    control add imgbutton, hPIN_Dlg, %ID_PINCanx, "PINCanx", _<br />
     &nbsp;&nbsp;191 - (36 * RatioX), 75 + (16 * RatioY), (36 * RatioX), (36 * RatioY)<br />
  end if<br />
  '<br />
  dialog show modal hPIN_Dlg call  PINDlgCB to PIN<br />
  function = PIN<br />
end function<br />
'================================================================= callback ====<br />
callback function PINDlgCB() as long<br />
  static A_IsExposed, B_IsExposed as long<br />
  static PINStr as wstring<br />
  local TmpL as long<br />
  local TmpS as wstring<br />
  if cb.msg = %wm_command then<br />
    if cb.ctlmsg = %en_update then<br />
      if (cb.ctl &gt;= %ID_PINA1Txtbx) and (cb.ctl &lt;= %ID_PINB9Txtbx) then<br />
        if (gNumOfDigits - 1) &gt; (&amp;h00000F and cb.ctl) then<br />
          control set focus cb.hndl, cb.ctl + 1<br />
        else<br />
          control set focus cb.hndl, %ID_PINB1Txtbx<br />
        end if<br />
      end if<br />
    elseif cb.ctlmsg = %bn_clicked then<br />
      select case as const cb.ctl<br />
        case %ID_PINAExposeBtn<br />
          if A_IsExposed then 'unexpose<br />
            for TmpL = %ID_PINA1Txtbx to %ID_PINA9Txtbx<br />
              control send cb.hndl, TmpL, %EM_SETPASSWORDCHAR,_<br />
               &nbsp;&nbsp;&amp;h2A, 0<br />
            next<br />
            control set imgbutton cb.hndl, %ID_PINAExposeBtn, "ShowPWon24"<br />
            A_IsExposed = 0<br />
          else 'expose<br />
            for TmpL = %ID_PINA1Txtbx to %ID_PINA9Txtbx<br />
              control send cb.hndl, TmpL, %EM_SETPASSWORDCHAR, 0, 0<br />
            next<br />
            control set imgbutton cb.hndl, %ID_PINAExposeBtn, "ShowPWoff24"<br />
            A_IsExposed = -1<br />
          end if<br />
          for TmpL = %ID_PINA1Txtbx to %ID_PINA9Txtbx<br />
            control redraw cb.hndl, TmpL<br />
          next<br />
        case %ID_PINBExposeBtn<br />
          if B_IsExposed then<br />
            for TmpL = %ID_PINB1Txtbx to %ID_PINB9Txtbx<br />
              control send cb.hndl, TmpL, %EM_SETPASSWORDCHAR,_<br />
               &nbsp;&nbsp;&amp;h2A, 0<br />
            next<br />
            control set imgbutton cb.hndl, %ID_PINBExposeBtn, "ShowPWon24"<br />
            B_IsExposed = 0<br />
          else 'expose<br />
            for TmpL = %ID_PINB1Txtbx to %ID_PINB9Txtbx<br />
              control send cb.hndl, TmpL, %EM_SETPASSWORDCHAR, 0, 0<br />
            next<br />
            control set imgbutton cb.hndl, %ID_PINBExposeBtn, "ShowPWoff24"<br />
            B_IsExposed = -1<br />
          end if<br />
          for TmpL = %ID_PINB1Txtbx to %ID_PINB9Txtbx<br />
            control redraw cb.hndl, TmpL<br />
          next<br />
        '············································· submit single button ····<br />
        case %ID_PINSubmitSnglBtn, %ID_PINSubmitDuplBtn<br />
          control get text cb.hndl, %ID_PINA1Txtbx to TmpS<br />
          PINStr = TmpS<br />
          for TmpL = 1 to 8<br />
            control get text cb.hndl, %ID_PINA1Txtbx + TmpL to TmpS<br />
            PINStr += TmpS<br />
          next<br />
          TmpL = len(PINStr)<br />
          if gIsVariableDigits then<br />
            if Tmpl &lt; 4 then<br />
              msgbox "Varible length PINs must be 4 to 9 digits "&#36;&#36; + _<br />
                   &nbsp;&nbsp;"and exactly the same as when it was created."&#36;&#36;, _<br />
                   &nbsp;&nbsp;%mb_ok or %mb_iconerror or %mb_taskmodal, gEntryErrTitle<br />
              exit function<br />
            end if<br />
          else<br />
            if TmpL &lt; gNumOfDigits then<br />
              msgbox "The program using this PIN requires "&#36;&#36; + _<br />
                   &nbsp;&nbsp;dec&#36;(gNumOfDigits) + " digits."&#36;&#36;, _<br />
                   &nbsp;&nbsp;%mb_ok or %mb_iconerror or %mb_taskmodal, gEntryErrTitle<br />
              exit function<br />
            end if<br />
          end if<br />
          if cb.ctl = %ID_PINSubmitDuplBtn then<br />
            for TmpL = 0 to 8<br />
              control get text cb.hndl, %ID_PINB1Txtbx + TmpL to TmpS<br />
                if TmpS = mid&#36;(PINStr, TmpL + 1, 1) then<br />
                  iterate for<br />
                else<br />
                  msgbox "The and the repeat do not match."&#36;&#36;, _<br />
                       &nbsp;&nbsp;%mb_ok or %mb_iconerror or %mb_taskmodal, _<br />
                       &nbsp;&nbsp;gEntryErrTitle<br />
                  exit function<br />
                end if<br />
              next<br />
          end if<br />
          if gIsVariableDigits then<br />
            TmpL = 9 - len(PINStr)<br />
            PINStr += string&#36;&#36;(TmpL, "0"&#36;&#36;)<br />
          end if<br />
          dialog end cb.hndl, val(PINStr)<br />
        case %ID_PINHelp<br />
       &nbsp;&nbsp;'' ShellExecute<br />
            ShellExecute (0, "open"&#36;&#36;, "PIN_Enter_Help.html", ""&#36;&#36;, ""&#36;&#36;, %sw_shownormal)<br />
        case %ID_PINCanx<br />
          goto NoPIN<br />
      end select<br />
    end if<br />
  elseif (lo(word, cb.wparam) = %sc_close) and (cb.msg = %wm_syscommand) then<br />
    goto NoPIN<br />
  end if<br />
  exit function<br />
  NoPIN:<br />
  TmpL = msgbox("""Yes"", to quit PIN entry."&#36;&#36; + &#36;&#36;crlf + _<br />
                """No"", to stay and enter a PIN."&#36;&#36;, _<br />
            %mb_yesno or %mb_iconquestion or %mb_defbutton2 or %mb_taskmodal, _<br />
            "Verify Quitting PIN Entry"&#36;&#36;)<br />
  if TmpL = %idno then<br />
    function = -1<br />
  else<br />
    dialog end cb.hndl<br />
  end if<br />
end function</code></div></div>Demo source: <br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>'File PIN_SLL_demo.bas<br />
#compile exe<br />
#dim all<br />
#if %def(%pb_cc32)<br />
  #console off<br />
#endif<br />
declare function PIN_Enter lib "EnterPIN.dll" alias "PIN_Enter" _<br />
                                            (byval hParent as dword, _<br />
                                           &nbsp;&nbsp;byval DuplPIN as long, _<br />
                                           &nbsp;&nbsp;byval NumOfDigits as long) as dword<br />
function pbmain () as long<br />
  local hTWin, PIN as dword<br />
  local Rspnc as wstring<br />
  txt.window("PIN Enter Popup Demonstration"&#36;&#36;, 400, 70, 20, 75) to hTWin<br />
  txt.color = %rgb_green<br />
  txt.print "At any wait use any key to continue. (like now :) )"&#36;&#36;<br />
  txt.waitkey&#36;<br />
  '<br />
  txt.color = %rgb_blue<br />
  txt.print "A dual PIN entry with number of digits set to 4. "&#36;&#36;;<br />
  txt.color = %rgb_black<br />
  txt.print "Returned PIN is: "&#36;&#36; + dec&#36;(PIN_Enter(hTWin, 1, 4), 4)"."&#36;&#36;<br />
  txt.color = %rgb_green<br />
  txt.print<br />
  txt.print "Any key to continue."<br />
  txt.waitkey&#36;<br />
  '<br />
  txt.color = %rgb_blue<br />
  txt.print "A single PIN entry with number of digits set to 4. "&#36;&#36;;<br />
  txt.color = %rgb_black<br />
  txt.print "Returned PIN is: "&#36;&#36; + dec&#36;(PIN_Enter(hTWin, 0, 4), 4)"."&#36;&#36;<br />
  txt.print<br />
  txt.color = %rgb_green<br />
  txt.print """ESC"" to end demo, any other key to continue with next."<br />
  Rspnc = txt.waitkey&#36;<br />
  if Rspnc = &#36;&#36;esc then exit function<br />
  '<br />
  txt.color = %rgb_blue<br />
  txt.print "Number of PIN digits set to 9. "&#36;&#36;;<br />
  txt.color = %rgb_black<br />
  txt.print "Returned PIN is: "&#36;&#36; + dec&#36;(PIN_Enter(hTWin, 0, 9), 9)"."&#36;&#36;<br />
  txt.color = %rgb_blue<br />
  txt.print "You had to enter 9 digits, or ""Cancel PIN"" to get here."&#36;&#36;<br />
  txt.print<br />
  txt.color = %rgb_green<br />
  txt.print """ESC"" to end demo, any other key to continue with next."<br />
  Rspnc = txt.waitkey&#36;<br />
  if Rspnc = &#36;&#36;esc then exit function<br />
  txt.color = %rgb_blue<br />
  txt.print "Number of PIN digits set to 0 (user preference). "&#36;&#36;<br />
  txt.print "Looks like previous, but 4 to 9 digits allowed."&#36;&#36;;<br />
  txt.print "Returned PIN is: "&#36;&#36; + dec&#36;(PIN_Enter(hTWin, 0, 0), 9)"."&#36;&#36;<br />
  '<br />
<br />
  '---------------------------------------------------------------------<br />
  txt.color = %rgb_green<br />
  txt.print<br />
  txt.print "Any key will close."&#36;&#36;<br />
  txt.waitkey&#36;<br />
end function</code></div></div>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Announcements for updates]]></title>
			<link>https://pump.richheimer.de/showthread.php?tid=125</link>
			<pubDate>Mon, 13 Apr 2026 14:16:56 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://pump.richheimer.de/member.php?action=profile&uid=71">Juergen Kuehlwein</a>]]></dc:creator>
			<guid isPermaLink="false">https://pump.richheimer.de/showthread.php?tid=125</guid>
			<description><![CDATA[There is an improved version of the experimental code converter for JKB (JKB_Convert.exe), please download the update package (update.zip) and unpack over your existing installation.]]></description>
			<content:encoded><![CDATA[There is an improved version of the experimental code converter for JKB (JKB_Convert.exe), please download the update package (update.zip) and unpack over your existing installation.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Sounds good!]]></title>
			<link>https://pump.richheimer.de/showthread.php?tid=124</link>
			<pubDate>Mon, 13 Apr 2026 00:54:44 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://pump.richheimer.de/member.php?action=profile&uid=23">Dale Yarker</a>]]></dc:creator>
			<guid isPermaLink="false">https://pump.richheimer.de/showthread.php?tid=124</guid>
			<description><![CDATA[From: <span style="font-weight: bold;" class="mycode_b">What´s different</span><br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>The syntax is (with some minor restrictions) compatible to PowerBASIC. These restrictions are:</blockquote>
The bit that caught my interest<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>- Variables must not be declared with "DIM" anymore! ...  Dim is exclusively used for dimensioning arrays. </blockquote>
 Big agreement and self-imposed in my code.<br />
<br />
   <br />
<blockquote class="mycode_quote"><cite>Quote:</cite>THREADED is not supported ATM.</blockquote>
Aww, when thread is needed it is needed. Since I seldom need it its not a big handicap for now.<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>- You may still declare multiple variables of the same data type in one single line. "LOCAL a, b, c AS LONG" is accepted. "LOCAL a&#36;, b AS DWORD, c AS LONG" throws an error, because a&#36;, b and c represent different data types.</blockquote>
Also self-imposed.<br />
<br />
I'll download now.  <img src="https://pump.richheimer.de/images/smilies/smile.png" alt="Smile" title="Smile" class="smilie smilie_1" /> I need to get closer to the bottom of "job jar" to try it.  <img src="https://pump.richheimer.de/images/smilies/sad.png" alt="Sad" title="Sad" class="smilie smilie_8" />]]></description>
			<content:encoded><![CDATA[From: <span style="font-weight: bold;" class="mycode_b">What´s different</span><br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>The syntax is (with some minor restrictions) compatible to PowerBASIC. These restrictions are:</blockquote>
The bit that caught my interest<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>- Variables must not be declared with "DIM" anymore! ...  Dim is exclusively used for dimensioning arrays. </blockquote>
 Big agreement and self-imposed in my code.<br />
<br />
   <br />
<blockquote class="mycode_quote"><cite>Quote:</cite>THREADED is not supported ATM.</blockquote>
Aww, when thread is needed it is needed. Since I seldom need it its not a big handicap for now.<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>- You may still declare multiple variables of the same data type in one single line. "LOCAL a, b, c AS LONG" is accepted. "LOCAL a&#36;, b AS DWORD, c AS LONG" throws an error, because a&#36;, b and c represent different data types.</blockquote>
Also self-imposed.<br />
<br />
I'll download now.  <img src="https://pump.richheimer.de/images/smilies/smile.png" alt="Smile" title="Smile" class="smilie smilie_1" /> I need to get closer to the bottom of "job jar" to try it.  <img src="https://pump.richheimer.de/images/smilies/sad.png" alt="Sad" title="Sad" class="smilie smilie_8" />]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[What is different]]></title>
			<link>https://pump.richheimer.de/showthread.php?tid=123</link>
			<pubDate>Sun, 12 Apr 2026 12:43:52 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://pump.richheimer.de/member.php?action=profile&uid=71">Juergen Kuehlwein</a>]]></dc:creator>
			<guid isPermaLink="false">https://pump.richheimer.de/showthread.php?tid=123</guid>
			<description><![CDATA[<span style="font-weight: bold;" class="mycode_b">What´s different</span><br />
<br />
The syntax is (with some minor restrictions) compatible to PowerBASIC. These restrictions are:<br />
<br />
<br />
- Variables must not be declared with "DIM" anymore! <br />
    LOCAL, GLOBAL, STATIC, INSTANCE or COMMON is required (= #DIM ALL in PB)!. Dim is exclusively used for dimensioning arrays. THREADED is not supported ATM.<br />
<br />
- You may still declare multiple variables of the same data type in one single line. "LOCAL a, b, c AS LONG" is accepted. "LOCAL a&#36;, b AS DWORD, c AS LONG" throws an error, because a&#36;, b and c represent different data types.<br />
<br />
<br />
- You may assign an intial value, e.g. "LOCAL x AS LONG = -1"<br />
<br />
<br />
- With variables you cannot have type specifiers anymore except for "&#36;" (dynamic ANSI string) or "&#36;&#36;" (dynamic wide string)<br />
<br />
<br />
- There are new data types: QWORD (unsigned 64 bit integer), SBYTE (signed 8 bit integer), XWORD (DWORD in 32 bit and QWORD in 64), XLONG (LONG in 32 bit and QUAD in 64)<br />
<br />
<br />
- Assembler code:   <br />
    ! cmp byte [esi], 0  -&gt; byte ptr (the key word "ptr" is mandatory, assembler error otherwise)<br />
    ! ret must become,  ! retn, (ret ends a stackframe)<br />
<br />
    !.if (eax == 0)<br />
    ! ... "<br />
    !.endif                     (MASM Hi-level syntax is possible)<br />
<br />
    XAX = EAX in 32 bit and RAX in 64 bit<br />
<br />
<br />
- Reserved words: there is a list of words, which are forbidden as variable or procedure names, eg. pos, count, enter, comment et. al<br />
<br />
<br />
- String expressions: no logical string expressions, but automatic build&#36;<br />
    e.g.        if a&#36; &lt; b&#36; and c&#36; &lt; d&#36; then<br />
                 ...<br />
            <br />
    must be    if a&#36; &lt; b&#36; then<br />
                      if c&#36; &lt; d&#36; then<br />
                      ...<br />
              <br />
    but a&#36; + b&#36; + c&#36;, is always compiled as BUILD&#36;(a&#36;, b&#36;, c&#36;), BUILD&#36; is valid syntax, but it is not necessary anymore              <br />
<br />
<br />
<br />
- Conditional compiling: code inside conditional compiling blocks (even if condition is not met) must be compilable<br />
    you cannot code anymore:<br />
    #IF 0<br />
    &lt;your comments here&gt; -&gt; you must pepend an apostrophe to make it a comment<br />
    #ENDIF<br />
<br />
<br />
#TRACE, #PROFILE and #CALLSTACK make use of the OutputDebugString Viewer, this is still experimental<br />
<br />
<br />
- Syntax:<br />
PARSE        (no special treatment for default separator "," and quotes)<br />
<br />
ISTRUE      (parenthesis are required, it´s a function not an operator)<br />
ISFALSE      (parenthesis are required, it´s a function not an operator)<br />
<br />
FORMAT&#36;      (only one formatting mask allowed)<br />
JOIN&#36;        (without BINARY option and special quote handling)<br />
PARSE&#36;      (without BINARY option and special quote handling)<br />
<br />
PRINT        (requires sparator (, ; spc() tab()) between expressions)<br />
<br />
<br />
<br />
<span style="font-weight: bold;" class="mycode_b">What´s new:</span><br />
<br />
#SEH - in case of a GPF, the offending line is shown in the IDE<br />
<br />
TIMING [END]  -  return elapsed time in µs, syntax: TIMING [END] qword/quadvar<br />
ISVALID(&lt;ptr&gt;) -  returns -1, if pointer points to valid memory, 0 otherwise<br />
<br />
SIN            -  y = SIN([deg/rad], x) default is deg, applies to all trigonometric functions<br />
<br />
ZIP:                                                                                  'zip into ziparchive<br />
' ZIP string s&#36;, filename (in ziparchive), ziparchive [, password] [, call callback]<br />
' ZIP filename(s), ziparchive [, password] [, call callback]<br />
' ZIP memory ptr, len, filename (in ziparchive), ziparchive [, password] [, call callback]<br />
ZIP&#36;:                                                                                  'zip into string<br />
' z&#36; = ZIP&#36;(string s&#36;, filename (in archive) [, password] [size = x] [, call callback]) <br />
' z&#36; = ZIP&#36;(filename(s) [, password] [size = x] [, call callback]) <br />
' z&#36; = ZIP&#36;(memory ptr, len, filename (in archive) [, password] [size = x] [, call callback]) <br />
UNZIP:                                                                                'unzip ziparchive<br />
' UNZIP filename(s) (in string), string s&#36; [, password] [to folder] [, call callback]<br />
' UNZIP filename(s) (in ziparchive), ziparchive [, password] [to folder] [, call callback]<br />
' UNZIP filename(s) (in memory), memory ptr, len [, password] [to folder] [, call callback]<br />
UNZIP&#36;                                                                                'unzip into string<br />
' s&#36;(&#36;) = UNZIP&#36;(filename (in string), string z&#36;|ziparchive] [, password])<br />
' s&#36;(&#36;) = UNZIP&#36;(filename (in ziparchive), ziparchive] [, password])<br />
' s&#36;(&#36;) = UNZIP&#36;(filename (in memory), memory ptr, len|ziparchive] [, password])<br />
ZIPINFO:                                                                              'return # of files in zip + array of zipinfo<br />
' x = ZIPINFO(array, string z&#36;|ziparchive [, password])            <br />
' x = ZIPINFO(array, memory ptr, len|ziparchive [, password])<br />
ZIPCALC:                                                                              'return # of bytes for zipped data<br />
' x = ZIPCALC(string s&#36;|filename(s))<br />
' x = ZIPCALC memory ptr, len|filename(s)<br />
UNZIPCALC:                                                                            'return # of bytes for unzipped data<br />
' x = UNZIPCALC( filename(s), string z&#36;|ziparchive [, password])<br />
' x = UNZIPCALC( filename(s), memory pointer, len|ziparchive [, password])<br />
<br />
<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Run 32 bit code:</span><br />
As a first step try to run 32 bit code. Please adapt your code according to the above restrictions. If there are many places to adapt, the Replace Dialog (Ctrl + R) is your friend. The first line must be "#COMPILER JKB [32]", "F9" compiles and executes. The IDE will complain about errors.<br />
<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Run 64 bit code:</span><br />
64 bit code definitely needs adaptions: all pointers and handles (which are pointers in fact) must become 64 bit data types (DWORD -&gt; XWORD and LONG -&gt; XLONG). The first line must be "#COMPILER JKB 64". <br />
<br />
<br />
<br />
There is a (still experimental) code converter (Credits to Norbert Spoerl for supplying ideas and major parts of code) for adapting existing code to the new requirements. You may use the menu (last item in "File" menu: "Prepare Source for JKB" ) or the top toolbar (a new button, next to the "command prompt" button on the right side). This feature is applied to current file in the IDE. A copy (&lt;name&gt;.original) is made before. Yet you may still have to adapt some things manually.<br />
<br />
<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Please don´t post in this thread, feel free to ask questions in "Discussions" thread</span>]]></description>
			<content:encoded><![CDATA[<span style="font-weight: bold;" class="mycode_b">What´s different</span><br />
<br />
The syntax is (with some minor restrictions) compatible to PowerBASIC. These restrictions are:<br />
<br />
<br />
- Variables must not be declared with "DIM" anymore! <br />
    LOCAL, GLOBAL, STATIC, INSTANCE or COMMON is required (= #DIM ALL in PB)!. Dim is exclusively used for dimensioning arrays. THREADED is not supported ATM.<br />
<br />
- You may still declare multiple variables of the same data type in one single line. "LOCAL a, b, c AS LONG" is accepted. "LOCAL a&#36;, b AS DWORD, c AS LONG" throws an error, because a&#36;, b and c represent different data types.<br />
<br />
<br />
- You may assign an intial value, e.g. "LOCAL x AS LONG = -1"<br />
<br />
<br />
- With variables you cannot have type specifiers anymore except for "&#36;" (dynamic ANSI string) or "&#36;&#36;" (dynamic wide string)<br />
<br />
<br />
- There are new data types: QWORD (unsigned 64 bit integer), SBYTE (signed 8 bit integer), XWORD (DWORD in 32 bit and QWORD in 64), XLONG (LONG in 32 bit and QUAD in 64)<br />
<br />
<br />
- Assembler code:   <br />
    ! cmp byte [esi], 0  -&gt; byte ptr (the key word "ptr" is mandatory, assembler error otherwise)<br />
    ! ret must become,  ! retn, (ret ends a stackframe)<br />
<br />
    !.if (eax == 0)<br />
    ! ... "<br />
    !.endif                     (MASM Hi-level syntax is possible)<br />
<br />
    XAX = EAX in 32 bit and RAX in 64 bit<br />
<br />
<br />
- Reserved words: there is a list of words, which are forbidden as variable or procedure names, eg. pos, count, enter, comment et. al<br />
<br />
<br />
- String expressions: no logical string expressions, but automatic build&#36;<br />
    e.g.        if a&#36; &lt; b&#36; and c&#36; &lt; d&#36; then<br />
                 ...<br />
            <br />
    must be    if a&#36; &lt; b&#36; then<br />
                      if c&#36; &lt; d&#36; then<br />
                      ...<br />
              <br />
    but a&#36; + b&#36; + c&#36;, is always compiled as BUILD&#36;(a&#36;, b&#36;, c&#36;), BUILD&#36; is valid syntax, but it is not necessary anymore              <br />
<br />
<br />
<br />
- Conditional compiling: code inside conditional compiling blocks (even if condition is not met) must be compilable<br />
    you cannot code anymore:<br />
    #IF 0<br />
    &lt;your comments here&gt; -&gt; you must pepend an apostrophe to make it a comment<br />
    #ENDIF<br />
<br />
<br />
#TRACE, #PROFILE and #CALLSTACK make use of the OutputDebugString Viewer, this is still experimental<br />
<br />
<br />
- Syntax:<br />
PARSE        (no special treatment for default separator "," and quotes)<br />
<br />
ISTRUE      (parenthesis are required, it´s a function not an operator)<br />
ISFALSE      (parenthesis are required, it´s a function not an operator)<br />
<br />
FORMAT&#36;      (only one formatting mask allowed)<br />
JOIN&#36;        (without BINARY option and special quote handling)<br />
PARSE&#36;      (without BINARY option and special quote handling)<br />
<br />
PRINT        (requires sparator (, ; spc() tab()) between expressions)<br />
<br />
<br />
<br />
<span style="font-weight: bold;" class="mycode_b">What´s new:</span><br />
<br />
#SEH - in case of a GPF, the offending line is shown in the IDE<br />
<br />
TIMING [END]  -  return elapsed time in µs, syntax: TIMING [END] qword/quadvar<br />
ISVALID(&lt;ptr&gt;) -  returns -1, if pointer points to valid memory, 0 otherwise<br />
<br />
SIN            -  y = SIN([deg/rad], x) default is deg, applies to all trigonometric functions<br />
<br />
ZIP:                                                                                  'zip into ziparchive<br />
' ZIP string s&#36;, filename (in ziparchive), ziparchive [, password] [, call callback]<br />
' ZIP filename(s), ziparchive [, password] [, call callback]<br />
' ZIP memory ptr, len, filename (in ziparchive), ziparchive [, password] [, call callback]<br />
ZIP&#36;:                                                                                  'zip into string<br />
' z&#36; = ZIP&#36;(string s&#36;, filename (in archive) [, password] [size = x] [, call callback]) <br />
' z&#36; = ZIP&#36;(filename(s) [, password] [size = x] [, call callback]) <br />
' z&#36; = ZIP&#36;(memory ptr, len, filename (in archive) [, password] [size = x] [, call callback]) <br />
UNZIP:                                                                                'unzip ziparchive<br />
' UNZIP filename(s) (in string), string s&#36; [, password] [to folder] [, call callback]<br />
' UNZIP filename(s) (in ziparchive), ziparchive [, password] [to folder] [, call callback]<br />
' UNZIP filename(s) (in memory), memory ptr, len [, password] [to folder] [, call callback]<br />
UNZIP&#36;                                                                                'unzip into string<br />
' s&#36;(&#36;) = UNZIP&#36;(filename (in string), string z&#36;|ziparchive] [, password])<br />
' s&#36;(&#36;) = UNZIP&#36;(filename (in ziparchive), ziparchive] [, password])<br />
' s&#36;(&#36;) = UNZIP&#36;(filename (in memory), memory ptr, len|ziparchive] [, password])<br />
ZIPINFO:                                                                              'return # of files in zip + array of zipinfo<br />
' x = ZIPINFO(array, string z&#36;|ziparchive [, password])            <br />
' x = ZIPINFO(array, memory ptr, len|ziparchive [, password])<br />
ZIPCALC:                                                                              'return # of bytes for zipped data<br />
' x = ZIPCALC(string s&#36;|filename(s))<br />
' x = ZIPCALC memory ptr, len|filename(s)<br />
UNZIPCALC:                                                                            'return # of bytes for unzipped data<br />
' x = UNZIPCALC( filename(s), string z&#36;|ziparchive [, password])<br />
' x = UNZIPCALC( filename(s), memory pointer, len|ziparchive [, password])<br />
<br />
<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Run 32 bit code:</span><br />
As a first step try to run 32 bit code. Please adapt your code according to the above restrictions. If there are many places to adapt, the Replace Dialog (Ctrl + R) is your friend. The first line must be "#COMPILER JKB [32]", "F9" compiles and executes. The IDE will complain about errors.<br />
<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Run 64 bit code:</span><br />
64 bit code definitely needs adaptions: all pointers and handles (which are pointers in fact) must become 64 bit data types (DWORD -&gt; XWORD and LONG -&gt; XLONG). The first line must be "#COMPILER JKB 64". <br />
<br />
<br />
<br />
There is a (still experimental) code converter (Credits to Norbert Spoerl for supplying ideas and major parts of code) for adapting existing code to the new requirements. You may use the menu (last item in "File" menu: "Prepare Source for JKB" ) or the top toolbar (a new button, next to the "command prompt" button on the right side). This feature is applied to current file in the IDE. A copy (&lt;name&gt;.original) is made before. Yet you may still have to adapt some things manually.<br />
<br />
<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Please don´t post in this thread, feel free to ask questions in "Discussions" thread</span>]]></content:encoded>
		</item>
	</channel>
</rss>