Launch a Video with Command Line

BlitzPlus Forums/BlitzPlus Programming/Launch a Video with Command Line

Avatara(Posted 2003) [#1]
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 !!!


semar(Posted 2003) [#2]
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 ?


Beaker(Posted 2003) [#3]
Have you checked what file$ contains? Try this:
Debuglog file$

And, have you issued a Graphics command?


Avatara(Posted 2003) [#4]
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$)


mrtricks(Posted 2003) [#5]
I think the CommandLine$() puts quote marks at either end... maybe you need to chop them off.


GfK(Posted 2003) [#6]
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