Launch a Video with Command Line
BlitzPlus Forums/BlitzPlus Programming/Launch a Video with Command Line
| ||
file$=CommandLine$() movie=OpenMovie(file$) If movie=0 Then RuntimeError file$+ " not loaded!" Compil this code and drag a movie (avi or mpg) on the .exe It don't work ! Why !!! |
| ||
Compil this code and drag a movie (avi or mpg) on the .exe It don't work ! Why !!! May be drag & drop is not (yet) supported by blitz ? |
| ||
Have you checked what file$ contains? Try this: Debuglog file$ And, have you issued a Graphics command? |
| ||
drag & drop is supported by blitz .. try it and u can see the result file$ contains exactly the pathname + file (u can can see in RuntimeError file$) |
| ||
I think the CommandLine$() puts quote marks at either end... maybe you need to chop them off. |
| ||
Yup. When you drag/drop, quotes are added (eradicates problems with spaces in filenames/paths etc). Try this:If Left$(Commandline$(),1) = Chr$(34) If Right$(Commandline$(),1) = Chr$(34) Execfile Replace$(Commandline$,chr$(34),"") Endif Endif Alternatively, if you need to keep quotes inside the commandline and just remove the outer ones: If Left$(Commandline$(),1) = Chr$(34) If Right$(Commandline$(),1) = Chr$(34) ExecFile Mid$(CommandLine$(),2,Len(CommandLine$())-2) Endif Endif |