Forum Navigation
You need to log in to create posts and topics.

FINDERINFO

Posted by: MAWRPh <MAWRPh@...>

I am trying to use this function but I can't figure out what is wrong. I had
it working fine and then all of a sudden it stopped working (of course it
happened after I made changes but not to this part of the code). I call it
from my initialization routine (which I did not change) and use it almost
cookie cutter from the FB examples.

I call it something like this:

LOCAL FN checkIncomingFiles
DIM 31 fName$ 'dim to hold incoming
DIM type& 'file information
DIM volRefNum%
DIM maxFiles%, doWhat%

maxFiles% = 1
DEFSTR LONG
doWhat% = FINDERINFO(maxFiles%, fName$, type&, volRefNum%)
LONG IF maxFiles% > 0 'if zero then nothing to do
SELECT doWhat%
CASE _openFiles
'do stuff
CASE _printFiles
END SELECT
END IF
END FN = maxFiles%

-----------------
LOCAL FN Initialize
DIM maxFiles%
[snip]
maxFiles% = FN checkIncomingFiles
'check the files
[snip]
END FN

I can't see anything wrong here or in any of my startup code (not much
happens before this). If I double click a file in the finder it starts my app
but maxFiles% = 0. I can open the same file using FILES$ once my app is
running. I checked to be sure my type & creator was properly set in the file.
I tried recompiling, quiting and reopening FB, throwing out my pi file,
rebuilding the desktop and restarting and then recompiling all without
success. I know that maxFiles% = 0 because I displayed it in an edit field to
check.

Any help would be appreciated.

Mark