Ahh sweet success! I got it working.
The key to getting the timed out Alert to work correctly is this: In the ENTERPROC, in the XELSE statement that does the timed out routine the %Hitee& must be set to the id of the PICT in your Splash Screen Alert - this is item 3 for mine
.
HOWEVER in the FN InitAlert the WHILE WEND must still be set to WHILE a% = 151 (a purely arbitrary number)
In my experimenting I tried setting both the a% and the %Hitee& to 3 and got a nice crash. So much for trial and error programming.
Here is the final routine modified to work if anyone is interested;
GOTO "endSkip"
"myFilter"
ENTERPROC(dialogPtr&, EvtPtr&, Hitee&)
boolean = 0
LONG IF {EvtPtr&}=_KeyDwnEvt
Key = PEEK(EvtPtr& + _evtMessage + 3)
SELECT CASE Key
CASE 27 'Escape=27
boolean = -1 'cancel Btn (item 2)
%Hitee&, 2
CASE 13, 3 'Return or Enter
boolean = -1
%Hitee&, 1
CASE ELSE
boolean = 0
END SELECT
XELSE
tocks&=FN TICKCOUNT
LONG IF tocks&>timeOut&
boolean = -1
%Hitee&, 3 '** id of PICT in Alert in ResEd =3 **
XELSE
boolean = 0 'adding this seems to help too
END IF
END IF
EXITPROC = boolean
"endSkip"
LOCAL FN InitAbout
dim myFilterAddr&, a%
timeOut&=FN TICKCOUNT+330 'set delay
myFilterAddr&=LINE "myFilter" ' get address of ENTERPROC
a%=FN ALERT(_AboutMAF,myFilterAddr&) ' call the Alert
END FN
'---------Main------
FN InitAbout
'Don't forget to enable call to FN InitAbout from
'AboutMyProgram under the Apple Menu.
boolean, Key, Hitee&, dialogPtr&, EvtPtr&, myFilterAddr& timeOut& and tocks& are all GLOBALS. You can put the "g" in front of them as in gHitee&. I'm only advising of corrections that have to be made to the programming in the article "Timing Out an Alert" by Robert Schenk in Inside BASIC Volume 5, No. 1, January 1995
Mikearrony@aol.com gave an interesting Function if I ever make my own non ResEd splash screen. I was, however, looking for the solution to making the Timed Out Alert demo work.
Hope my trials and tribulations over this are useful to someone else.
Robert Schenk sent me an email too to point out that the original demo was meant to cycle - Thanks. The key is that the %Hitee& must be set to someting in your Alert like the PICT or STATIC text.
P.S. I'm marking the necessary corrections in my copy of the Inside BASIC mag.!
I use this that times out , clicks or keypress cancels. numTicks& is the length of time you select for it to be shown.
DIM numTicks&,endTicks&,timeUp
LOCAL FN MyShowSplash(numTicks&)
WINDOW #10,"",(0,0)-(450,320),_dialogPlain
PICTURE FIELD #1,"Intro",(0,0) - (450,320), _noFramedNoCr,_cropPict
endTicks& = FN TICKCOUNT + numTicks&
timeUp = _false
WHILE (FN BUTTON = _false) AND (INKEY$ = "") AND (timeUp = _false)
LONG IF numTicks& > 0
IF (FN TICKCOUNT => endTicks&) THEN timeUp = _zTrue
END IF
WEND
FLUSHEVENTS
END FN