This may or may not be a bug, but here's what happened and how I fixed it.
I connected a mobile phone as GSM Modem and ran the queries, one by one:
AT
AT+CMGF=1
AT+CMGL="ALL"
The final one, which should retrieve all SMS messages worked but it missed a lot of letters, even words. I tried lots of configurations for speed, flow control, etc. Nothing worked. But then I saw that in ComExample there is one line:
count := 0; //indicate done processing buf;
In my version 4.0 (downloaded 2010-11-21), the Count parameter is NOT declared as var in the OnRxChar event declaration.
I changed this in CPortTypes, from
TRxCharEvent = procedure(Sender: TObject; Count: Integer) of object;
to
TRxCharEvent = procedure(Sender: TObject; var Count: Integer) of object;
After running the commands again, everything works without any error. No missed letters, no mixed up messages.
I hope this helps someone.