Jump to content

Can I insert Parenthesis here?


Recommended Posts

Run ("C:\Program Files\K-Lite Codec Pack\Media Player Classic\mplayerc.exe " &$video_file& " -close")

I want it to output to windows command line:

Run "C:\Program Files\K-Lite Codec Pack\Media Player Classic\mplayerc.exe " "ab.avi" -close)

but I cant get the code to produce the parenthesis around the $video_file

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Link to comment
Share on other sites

Run ("C:\Program Files\K-Lite Codec Pack\Media Player Classic\mplayerc.exe " &$video_file& " -close")

I want it to output to windows command line:

Run "C:\Program Files\K-Lite Codec Pack\Media Player Classic\mplayerc.exe " "ab.avi" -close)

but I cant get the code to produce the parenthesis around the $video_file

Run (@ProgramFilesDir & "\K-Lite Codec Pack\Media Player Classic\mplayerc.exe " '"ab.avi"' -close)

or

Run (@ProgramFilesDir & "\K-Lite Codec Pack\Media Player Classic\mplayerc.exe " & Chr(34) & $video_file & Chr(34) & " -close")

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

or, even easier:

Run ('C:\Program Files\K-Lite Codec Pack\Media Player Classic\mplayerc.exe " &$video_file& " -close')

You can use single quotes in the begining and end, then, the " will stay as it is

My own pocket emo http://www.mindistortion.net/pocketemo/?da...1-7-2-0-0-1-0-0LOL[quote name='beerman' post='399180' date='Sep 6 2007, 08:45 AM']I have learned, never think inside the box. The moment you have a bright idea, and stand up to quickly exclaiming, "Eureka, I have it!". You will knock yourself out, from bashing your head on the inside of the box as you stand... So in conclusion it is always safer to think outside the box. :)[/quote]

Link to comment
Share on other sites

Run ("C:\Program Files\K-Lite Codec Pack\Media Player Classic\mplayerc.exe " &$video_file& " -close")

I want it to output to windows command line:

Run "C:\Program Files\K-Lite Codec Pack\Media Player Classic\mplayerc.exe " "ab.avi" -close)

but I cant get the code to produce the parenthesis around the $video_file

Perhaps you want double quotes vice parenthesis...

Single quotes enclosing literal double quotes:

Run ('C:\Program Files\K-Lite Codec Pack\Media Player Classic\mplayerc.exe "' & $video_file & '" -close')

You can also just double them up to include them literally:

Run ("C:\Program Files\K-Lite Codec Pack\Media Player Classic\mplayerc.exe """ &$video_file& " ""-close")
In this example you see triple double quotes because one double quote is for enclosing the string, and then a double double quote put it literally in the string. (Obviously the previous example is cleaner...)

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

or, even easier:

Run ('C:\Program Files\K-Lite Codec Pack\Media Player Classic\mplayerc.exe " &$video_file& " -close')

You can use single quotes in the begining and end, then, the " will stay as it is

That one is good also. There are several different ways.

Personally I wouldn't have changed the Run he had in the codebox. Instead (it's obvious that he declared the file as a variable so if it were like this

$video_file = "MyFile.avi"

Just add

$video_file + Chr(34) & $video_file & Chr(34)

Then he could have passed it to the run as he did. BTW the reason I use Chr(34) is because it is far more readable then '"'

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...