here's small demo on how you can use libpari http://pari.math.u-bordeaux.fr/
this demo show but a tiny bit of what you can do with the lib
note, some functions will only work on a real console window hence my use of $Console:Only and _Dest _Console
attached below is the libpari dll if you don't want to install Pari/gp
Declare Dynamic Library "libpari"
Sub pari_init (ByVal parisize~&&, Byval maxprime~&&)
Sub pari_close()
Sub pari_print_version ()
Function setdefault~&& (s As String, v As String, Byval flag&&)
Function strtoGENstr~&& (s As String)
Function setrealprecision&& (ByVal n&&, prec&&)
Function GENtostr$ (ByVal x~&&)
Function geval~&& (ByVal x~&&)
Sub outmat (ByVal x~&&)
Function gp_input~&& ()
Function stoi~&& (ByVal x&&)
Function abscmpiu& (ByVal x~&&, Byval y As _Unsigned _Integer64)
Function abscmpui& (ByVal x As _Unsigned _Integer64, Byval y~&&)
Function absequaliu& (ByVal x~&&, Byval y As _Unsigned _Integer64)
Function gequal& (ByVal x~&&, Byval y~&&)
Function gcmp& (ByVal x~&&, Byval y~&&)
End Declare
Dim As _Unsigned _Integer64 a, b, c, d, e, f
Dim As String s1, s2, s3
Dim As _Integer64 flag, prec
pari_init 80000000, 500000
pari_print_version
Print
prec = setrealprecision(50, prec)
s1 = "seriesprecision" + Chr$(0): s2 = "12" + Chr$(0)
f = setdefault(s1, s2, flag)
s1 = "fibonacci(300)" + Chr$(0)
a = strtoGENstr(s1) 'convert to GEN string
b = geval(a) 'eval the string in a
'outmat b
s3 = GENtostr(b) 'convert GEN to string
Print "fibonacci(300) = "; s3
s1 = "50!" + Chr$(0)
a = strtoGENstr(s1) 'convert to GEN string
b = geval(a) 'eval the string in a
'outmat b
s3 = GENtostr(b) 'convert GEN to string
Print "50! = "; s3
s1 = "sin(x)" + Chr$(0)
a = strtoGENstr(s1) 'convert to GEN string
b = geval(a) 'eval the string in a
'outmat b
s3 = GENtostr(b)
Print "sin(x) = "; s3
Print "evaluate a tiny program: for(i=2, 10, print(sqrt(i)))"
s1 = "for(i=2, 10, print(sqrt(i)))" + Chr$(0)
a = strtoGENstr(s1)
c = geval(a)
Print
Print "enter an expression or simply press return to exit the loop"
s1 = " "
While s1 <> ""
Input "enter an expression ", s1
s2 = s1 + Chr$(0)
c = strtoGENstr(s2)
a = geval(c)
outmat a
Wend
'Print "enter an A ";: a = gp_input
'Print "enter an B ";: b = gp_input
'Print gequal(a, b)
'Print gcmp(a, b)
'Print abscmpiu(a, 0)
'Print abscmpui(0, a)
'Print absequaliu(a, 0)
s1 = "plot(x=-Pi,Pi,sin(x))" + Chr$(0)
a = strtoGENstr(s1) 'convert to GEN string
Print "sin(x) = ";
b = geval(a) 'eval the string in a
pari_close
output
Code: (Select All)
GP/PARI CALCULATOR Version 2.13.4 (released)
amd64 running mingw (x86-64/GMP-6.1.2 kernel) 64-bit version
compiled: Mar 25 2022, gcc version 8.3-posix 20190406 (GCC)
threading engine: single
(readline v8.0 disabled, extended help enabled)
I expanded a bit on one of Dav's old programs, that used Shift + A to restore an automatically minimized window.
This demo uses the F3 key. It has (3) effects. The usual min and restore effect, which shows a shadow effect as the window changes to minimized and restored, a method that eliminates that effect, and one that merely hides the window and restores it. Use TAB to select which effect to use.
Obviously, this works on Windows platforms, only....
Code: (Select All)
REM Based on the "Cheapo Windows Hotkey" program coded by Dav.
DECLARE DYNAMIC LIBRARY "user32"
REM FUNCTION FindWindowA%& (BYVAL ClassName AS _OFFSET, WindowName$) 'find process handle by title
FUNCTION GetKeyState% (BYVAL nVirtKey AS LONG) 'Windows virtual key presses
FUNCTION ShowWindow& (BYVAL hwnd AS _OFFSET, BYVAL nCmdShow AS LONG) 'maximize process
FUNCTION GetForegroundWindow%& 'find currently focused process handle
FUNCTION SetForegroundWindow& (BYVAL hwnd AS _OFFSET) 'set foreground window process(focus)
END DECLARE
title$ = "Minimize-Restore Windows Demo" 'title of program window
_TITLE title$
DO
i = i + 1
_LIMIT 10
REM hwnd%& = FindWindowA(0, title$ + CHR$(0)) 'find this program's process handle
hwnd%& = _WINDOWHANDLE
IF i > 100000 THEN PRINT "Cannot obtain window handle.": END
LOOP UNTIL hwnd%&
keyact = 114
status = 0 ' Regular window.
DO
_LIMIT 30
SELECT CASE status
CASE 0
IF msg = 0 THEN
CLS
PRINT "Press F3 to toggle minimize / restore window.": PRINT
msg = 1
y% = CSRLIN
GOSUB menu
END IF
IF GetKeyState(9) < 0 THEN
LOCATE y%, 1: PRINT SPACE$(_WIDTH);: LOCATE y%, 1
demo = demo + 1: IF demo > 2 THEN demo = 0
GOSUB menu
DO: _LIMIT 30: LOOP UNTIL GetKeyState(9) >= 0
END IF
IF GetKeyState(keyact) < 0 THEN '<==== F3
SELECT CASE demo
CASE 0 ' Minimize with effect.
x& = ShowWindow&(hwnd%&, 2)
CASE 1 ' Minimize without effect.
x& = ShowWindow&(hwnd%&, 0)
_DELAY .33
x& = ShowWindow&(hwnd%&, 2)
x& = ShowWindow&(hwnd%&, 5)
CASE 2 ' Hide window only.
y& = ShowWindow&(hwnd%&, 0)
END SELECT
DO: _LIMIT 30: LOOP UNTIL GetKeyState(keyact) >= 0
status = 1
END IF
CASE 1
IF GetKeyState(keyact) < 0 THEN '<==== F3
FGwin%& = GetForegroundWindow%& 'get current process in focus
SELECT CASE demo
CASE 0 ' Restore with effect.
y& = ShowWindow&(hwnd%&, 9) ' Restore to original state.
CASE 1 ' Restore without effect.
y& = ShowWindow&(hwnd%&, 0)
_DELAY .3
y& = ShowWindow&(hwnd%&, 9)
y& = ShowWindow&(hwnd%&, 5)
CASE 2 ' Show window only.
DO
y& = ShowWindow&(hwnd%&, 5)
LOOP UNTIL y&
END SELECT
IF FGwin%& <> hwnd%& THEN z& = SetForegroundWindow&(hwnd%&) 'set focus when necessary
DO: _LIMIT 30: LOOP UNTIL GetKeyState(keyact) >= 0
status = 0
END IF
END SELECT
LOOP UNTIL INKEY$ = CHR$(27) AND status = 0
SYSTEM
menu:
SELECT CASE demo
CASE 0
PRINT "Tab Menu: Show screen on transition and minimize.": PRINT
CASE 1
PRINT "Tab Menu: Hide screen on transition and minimize.": PRINT
CASE 2
PRINT "Tab Menu: Hide window on transition.": PRINT
END SELECT
RETURN
REM ============================== VALUES ===================================
$IF THEN
SW_HIDE
0 Hides the window and activates another window.
---------------------------------------------------------------------------------------------
SW_SHOWNORMAL
SW_NORMAL
1 Activates and displays a window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when displaying the window for the first time.
---------------------------------------------------------------------------------------------
SW_SHOWMINIMIZED
2 Activates the window and displays it as a minimized window.
---------------------------------------------------------------------------------------------
SW_SHOWMAXIMIZED
SW_MAXIMIZE
3 Activates the window and displays it as a maximized window.
---------------------------------------------------------------------------------------------
SW_SHOWNOACTIVATE
4 Displays a window in its most recent size and position. This value is similar to SW_SHOWNORMAL, except that the window is not activated.
---------------------------------------------------------------------------------------------
SW_SHOW
5 Activates the window and displays it in its current size and position.
---------------------------------------------------------------------------------------------
SW_MINIMIZE
6 Minimizes the specified window and activates the next top-level window in the Z order.
---------------------------------------------------------------------------------------------
SW_SHOWMINNOACTIVE
7 Displays the window as a minimized window. This value is similar to SW_SHOWMINIMIZED, except the window is not activated.
---------------------------------------------------------------------------------------------
SW_SHOWNA
8 Displays the window in its current size and position. This value is similar to SW_SHOW, except that the window is not activated.
---------------------------------------------------------------------------------------------
SW_RESTORE
9 Activates and displays the window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when restoring a minimized window.
---------------------------------------------------------------------------------------------
SW_SHOWDEFAULT
10 Sets the show state based on the SW_ value specified in the STARTUPINFO structure passed to the CreateProcess function by the program that started the application.
---------------------------------------------------------------------------------------------
SW_FORCEMINIMIZE
11 Minimizes a window, even if the thread that owns the window is not responding. This flag should only be used when minimizing windows from a different thread.
---------------------------------------------------------------------------------------------
$END IF
What could be interesting and cool would be a sub-wiki or thread dedicated to simply compiling links (+source code) to versions of every classic game done in QB64 (or a link to source code for any done in another language). This might help beginning programmers looking to recreate a certain game or learn.
We all worried when there was the change at the top of QB64 and the reassurances were not enough to dispel the doubts...
I'm definitely off topic but try to understand me... I don't know anything about what happened and I can't orient myself... it's gone (almost) everything... and qb64 looks dead (for sure he is dying).
QB64 Phoenix is a fork of QB64... ?
In addition to all this there is also the fact of the language (I do not speak English) which makes everything more difficult
Years of development in QB64 destined to die... is it possible that this is destiny?
Tell me something please and inform me about the situation...
Thank you!
------
I read the presentation of SMcNeill but you know and give for obvious a bunch of things that I do not know.
And if qb64 phonex is a "clone" of qb64 as compatible with the original?
Someone has access to the old forum threads ? In need to monitor some raspberry pi's on my home network using ping. I know the old forum had some before it all got nuked. Some very good examples and code. I should have saved a couple (my bad).
If someone saved the old forum (pre-nuking) please provide a URL.
DavsIDE is an alternative IDE to use with QB64. I started this back in 2010, when QB64's IDE was still very slow to use. However, the QB64 IDE today is FAR better than back in 2010 , making my IDE almost useless now. Although DavsIDE is no longer being actively developed, I will update it from time to time to correct bugs and to thank the people that have supported it over the years. It has a read me file (DavsIDE.txt) so read that for more information on how to use the IDE.
- Dav
NOTE: This is for Windows only, and is in .EXE format only, no source included.
Latest version:
davside-v131.zip (Size: 467.75 KB / Downloads: 400)
(Uses the newer font, with more selectable font sizes, 8pt to 18pt)
Working with an error in my QB64 IDE, with the help of RNBW, (posted about here) it was discovered the latest version of QB64 won't compile correctly when the .BAS filename has an $ in it. Previous QB64 versions did compile them, but not v0.6 and newer.
Example, save a file with $ in it, like Money$.bas, it will have a compile error. Without the $ it will compile.