Ah right, I understand now, you need to look at the command line parameters for your executable to see if a file has been passed to it.
assuming no other command line options are going to be used, you could do something like:
assuming no other command line options are going to be used, you could do something like:
file$=CommandLine$() ;REMOVE THE QUOTES file$= Left(file$,Len(file$)-1) file$ = Right(file$, Len(file$)-1) If FileType(file$) = 1 then LoadFile(file$) ;file exists