Is anyone here currently coding with or fluent with PureBasic? Just curious as I use it a ton. Its super easy to whip up programs, and run without dependencies creating a super small exe or dll file. It has similarities to some languages like VB, Delphi, and C. Here's a sample console program that compiles to 13 kb uncompressed, and displays the product key in windows using some reg queries.
I think this language is cool as hell, like delphi was back in the 5,6,7 version era. It has lots of built-in capabilities, as well as the ability to simply call native system API's or DLL calls.
It's also compatible (sorta) with MacOS and Linux, providing your code detects different OS's at compile-time. purebasic[dot]com/documentation/index.html
I just re-signed up, so this is my random first discussion post. I haven't been here, nor around the scene in general in a long long time. Cool to see this site is still around.
Code
Procedure.s GetWindowsProductKey()
#KEY_WOW64_64KEY = $100
Protected hKey, Res, size = 280
Protected i, j, x, Result.s
Protected *mem = AllocateMemory(size)
Protected *newmem = AllocateMemory(size)
Protected *digits = AllocateMemory(25)
PokeS(*digits, "BCDFGHJKMPQRTVWXY2346789", -1, #PB_Ascii)
If OSVersion() <= #PB_OS_Windows_2000
Res = RegOpenKeyEx_(#HKEY_LOCAL_MACHINE, "Software\Microsoft\Windows NT\CurrentVersion", 0, #KEY_READ, @hKey)
Else
Res = RegOpenKeyEx_(#HKEY_LOCAL_MACHINE, "Software\Microsoft\Windows NT\CurrentVersion", 0, #KEY_READ | #KEY_WOW64_64KEY, @hKey)
EndIf
If Res = #ERROR_SUCCESS
RegQueryValueEx_(hKey, "DigitalProductID", 0, 0, *mem, @size)
RegCloseKey_(hKey)
If size <> 280
For i = 24 To 0 Step -1
x = 0
For j = 66 To 52 Step -1
x = (x << 8) + PeekA(*mem + j)
PokeA(*mem + j, x / 24)
x % 24
Next
PokeA(*newmem + i, PeekA(*digits + x))
Next
For i = 0 To 15 Step 5
Result + PeekS(*newmem + i, 5, #PB_Ascii) + "-"
Next
Result + PeekS(*newmem + 20, 5, #PB_Ascii)
EndIf
EndIf
FreeMemory(*mem) : FreeMemory(*newmem) : FreeMemory(*digits)
ProcedureReturn Result
EndProcedure
OpenConsole()
PrintN(GetWindowsProductKey())I think this language is cool as hell, like delphi was back in the 5,6,7 version era. It has lots of built-in capabilities, as well as the ability to simply call native system API's or DLL calls.
It's also compatible (sorta) with MacOS and Linux, providing your code detects different OS's at compile-time. purebasic[dot]com/documentation/index.html
I just re-signed up, so this is my random first discussion post. I haven't been here, nor around the scene in general in a long long time. Cool to see this site is still around.

