Recent posts

#1
Windows API Headers / Re: Where i can found Gary Bee...
Last post by Zlatko Vid - July 16, 2025, 09:51:19 AM
OK so everything is there ...
I don't know if GB have source code
as it is code editor with splitter  windows is great
example and can be translated to OxygenBasic program.
#2
General Discussion / Re: José / Unicode UTF16 Surro...
Last post by Theo Gottwald - July 15, 2025, 09:00:59 AM
UTF-16, UTF-32, broken surrogates?
Sounds like a Wasps nest to me?
Did you include all that stuff in your compiler Charles?

Unicode, Surrogate Pairs & UTF‑32 in Go and Free Pascal



0 → 0x10 FFFF in practice
TermWhat it really isWhy it matters to the compiler
Unicode scalar valueAny code point except 0xD800–0xDFFFCompilers can say "one scalar value = one character", ignoring UTF‑16 artefacts
Surrogate pairTwo UTF‑16 code units that encode one scalar value ≥ 0x10000Only relevant if the data is stored in UTF‑16
UTF‑32 / UCS‑4 charOne 32‑bit integer that equals the scalar valueNo surrogate logic needed; every code point fits



Go (current toolchain 1.23‑dev)
AspectHow Go handles it
Source encodingCompiler expects the file to be valid UTF‑8
String / rune literals[tt]\uXXXX[/tt] escapes may NOT name a surrogate; use [tt]\U0001F600[/tt] instead of a pair
Data representation[tt]string[/tt] = immutable UTF‑8; [tt]rune[/tt] = 32‑bit scalar (built‑in UTF‑32 cell)
Library helpers[tt]encoding/utf16[/tt] offers [tt]Encode[/tt]/[tt]Decode[/tt]/[tt]IsSurrogate[/tt]
JSON & friendsParsers merge [tt]\uXXXX\uXXXX[/tt] into a single rune; invalid pairs become U+FFFD
Every‑day impactYou never see surrogates unless you purposely handle UTF‑16



Free Pascal (FPC 3.2.x / 3.3‑trunk)
ConceptFree Pascal type / facility
UTF‑16 storage[tt]WideChar[/tt] (16‑bit) & [tt]UnicodeString[/tt]/[tt]WideString[/tt]; non‑BMP stored as two cells
Surrogate helpersUnit [tt]Character[/tt] (Delphi‑compatible): [tt]IsSurrogate[/tt], [tt]ConvertToUtf32[/tt], [tt]ConvertFromUtf32[/tt]
UTF‑32 storage[tt]UCS4Char[/tt] (32‑bit) & dynamic [tt]UCS4String[/tt]
Source codeParser expects UTF‑8; you may embed a pair as [tt]#$D83D#$DE00[/tt]
Conversions[tt]SysUtils[/tt] + [tt]LazUTF8[/tt] for UTF‑8 ⇄ UTF‑16 / UTF‑32
Every‑day impactIf you stick to [tt]UTF8String[/tt] or [tt]UCS4String[/tt], you rarely care about surrogates

Code (pascal) Select
program Smile32;
uses SysUtils, Character;

var
s16 : UnicodeString;
cp : UCS4Char;
begin
s16 := #$D83D#$DE00; // 😀 in UTF‑16
cp := ConvertToUtf32(s16, 1); // -> $1F600
Writeln('U+' + IntToHex(cp, 6));
end.



Side‑by‑side summary
GoFreePascal
Default string encodingUTF‑8Platform‑dependent (UTF‑8 on nix, UTF‑16 on Windows)
"One code‑point" primitive[tt]rune[/tt][tt]UCS4Char[/tt]
Literal rejects half‑surrogate?Yes (compile‑time error)No (validated at run time if you ask)
Std‑lib helpers[tt]encoding/utf16[/tt][tt]TCharacter.[/tt]
Need to think about pairs daily?RarelyOnly when you keep data in UTF‑16



Practical guidelines

Go
  • Write non‑BMP literals with [tt]\UXXXXXXXX[/tt] or raw UTF‑8 bytes.
  • Convert to/from UTF‑16 only when calling external APIs that demand it.

Free Pascal
  • Prefer [tt]UTF8String[/tt] or [tt]UCS4String[/tt] for pure‑Pascal text.
  • Use [tt]ConvertToUtf32[/tt] / [tt]ConvertFromUtf32[/tt] when crossing a UTF‑16 boundary.
  • If you must slice a UTF‑16 string, validate pairs first with [tt]TCharacter.IsSurrogate[/tt] helpers.



Both compilers give full Unicode reach; they only differ in when surrogate‑pair logic surfaces—compile‑time rejection in Go, run‑time helpers in Free Pascal.
#3
Third-Party Add-Ons / Börje Hagsten Files and Link t...
Last post by Theo Gottwald - July 15, 2025, 08:40:51 AM
 Börje Hagsten's Files
This is a small repository of files that Börje Hagsten has created to use with PowerBASIC. I've created this simple page to provide a place to download the excellent utility POFFS as well as many of the files found at his original site. If you're interested in his status, peruse the post that I made on the PB forums.

https://www.reonis.com/POFFS/


and here is the link to GBSnippets

https://www.garybeene.com/sw/gbsnippets.htm





#4
Windows API Headers / Re: Where i can found Gary Bee...
Last post by Theo Gottwald - July 15, 2025, 08:38:02 AM
I saw that
https://www.garybeene.com/sw/gbsnippets.htm
ist still available.
Also i found this:
https://www.reonis.com/POFFS/
#5
Windows API Headers / Re: Where i can found Gary Bee...
Last post by Zlatko Vid - July 15, 2025, 08:09:42 AM
It was long time ago i checked/used Gary Beene snippets
then i finally find it in one folder
..and strange some things missing(i think)
looks like are deleted or simply are not there
i mean on source codes of his programs
hmm that is strange
maybe i have it somewhere else
so i must look where they are
#6
Windows API Headers / Re: Where i can found Gary Bee...
Last post by Theo Gottwald - July 13, 2025, 02:49:38 PM
Can you upload all stuff that is hard to find into the "THird Party" Section of the forum, then everybody can download and use it.
#7
Deutsches Board (IT-Themen) / Re: Der Neue
Last post by Theo Gottwald - July 13, 2025, 02:47:49 PM
Hallo Peter,

willkommen im Forum.
Wir haben die deutsche Ecke und es gab hier und da auch mal einen der das genutzt hat (Peter Weiss war wohl der letzte).
Alle anderen Forumsteilnehmer die mir gerade einfallen sprechen nur english oder spanisch.
 
#8
Deutsches Board (IT-Themen) / Der Neue
Last post by Peter Salomon - July 10, 2025, 09:45:43 AM
Hallo zusammen!

Ich bin neu hier und ein Fan von PowerBASIC für Windows.
Für die Vorgeschichte müsste ich etwas ausholen, weil es "um 1000 Ecken" geht.
Der Einfachheit halber kann das hier nachgelesen werden: ->
https://www.mikrocontroller.net/topic/574459#new

Es ist ein ellenlanger Thread, wo ich mit meinem TO nur niedergemacht wurde und fast niemand sich die Mühe gemacht hat auch nur ansatzweise mal in die über 2000 Seiten Doku zu schauen.

Wie ich dort schon schrieb, hat die 10er Version von PBWin nur noch sehr wenig mit BASIC zu tun und umso mehr ich mich durch die Doku übersetzenderweise gequält habe, umso mehr bin ich von diesem einzigartigen Programmierwerkzeug überzeugt.

In meinen weiteren Postings im o.g. Thread hatte ich dann erklärt, warum und wieso ich eigentlich auf PowerBASIC gekommen bin.
Einige ganz kleine, aber grundlegende Versuche habe ich schon machen können, aber das eigentliche Vorhaben - die COM-Schnittstelle von TurboCAD bedienen zu können, steht noch aus.

Zwischenzeitlich hatte ich versucht mich im Original PowerBASIC-Forum anzumelden, aber das ist bis heute in der Schwebe, d.h. die Authetifizierung durch den Admin ist immer noch nicht erfolgt.
Auch der direkte Kontakt zu Gary Beene war letztendlich nicht erfolgreich.

So bin ich sehr froh nun hier gelandet zu sein - und auch noch in deutsch schreiben zu können!


So viel für heute.

Grüsse aus Ahrensfelde (bei Berlin)


Peter Salomon
www.ps-blnkd.de
#9
Windows API Headers / Re: StrCSpnIW
Last post by José Roca - June 27, 2025, 10:36:15 PM
Thanks very much, Pierre.
#10
Windows API Headers / StrCSpnIW
Last post by Pierre Bellisle - June 27, 2025, 10:45:24 AM
Hi José,

in Shlwapi.inc
DECLARE FUNCTION StrCSpnIW IMPORT "SHLWAPI.DLL" ALIAS "StrSpnIW"( _
should be
DECLARE FUNCTION StrCSpnIW IMPORT "SHLWAPI.DLL" ALIAS "StrCSpnIW" ( _

Take care...