Hello Andrew,
I have already written the applet but it is extremely trivial. It is posted below. For something with more "meat", check out my applet called "a faster doevents" posted under samples in the wiki. I am, by no means, a pascal wizard. I know just enough to be dangerous.
There are more applets that may be downloaded on the iziBasic home page. You'll need the pp compiler, so when you download it, it will have many more applets to study. Hope this helps.
Regards,
JoeV
p.s. Aldweb, perhaps your next version of iziBasic might have a statement called "FLUSHQUEUE"?
{ 13-Apr-2007
This applet flushes the event queue.
Call the applet from izibasic using the format: R$=CALLPP(161)
R$ always returns "Events Cleared"
}
{$code appl,JVxx,code,161} //required by iziBasic
program ppcall161;
{$i PalmAPI.pas}
type
iBasFunType=function(S:string):string; //required by iziBasic
var iBasCallPP:iBasFunType; //required by iziBasic
function EvtFlushKeyQueue:Err;inline(SYSTRAP,$A12C);
function EvtFlushPenQueue:Err;inline(SYSTRAP,$A125);
function EvtFlushNextPenStroke:Err;inline(SYSTRAP,$A129);
function CallPP(S:string):string;
begin
EvtFlushKeyQueue;
EvtFlushPenQueue;
EvtFlushNextPenStroke;
callpp:='Events Cleared'; //return string
end;
//Main. Required by iziBasic
begin
iBasCallPP:=CallPP;
end.