Sign in to follow this  
Followers 0
TehWhale

Double Quote usage

9 posts in this topic

#1 ·  Posted (edited)

So, basically im tring to make a Standalone chrome.exe, so i have a _FileListToArray array of files, and i want to output like this, for example, it would be:

FileInstall("Chrome\locales\vi.dll", @TempDir&"\Chrome\locales\vi.dll")

Using filewrite and such, so in the script, it'll be like:

_FileListToArray(@ScriptDir&"\Chome\locales\", "*.*", 1)

Then, I know im using locales folder, so

For $i=1 to $FileArray[0]

FileWrite(@ScriptDir&"\blah.au3", "FileInstall('Chrome\locales\'& $FileArray[0]&', @TempDir&'\'&"&$FileArray[$i])

Next

And that's always giving me errors...

Just to clarify, I want the variable in the script, the file, but i want @TempDir written, not MY temporoary directory.

Edited by SwiftBurns

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

FileWrite(@ScriptDir&"\blah.au3", "FileInstall('Chrome\locales\" & $FileArray[0] & "', @TempDir & "\" & $FileArray[$i] & "')")

Edited by Rick

Who needs puzzles when we have AutoIt!!

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Share this post


Link to post
Share on other sites

You can't use a variable in the source. Ever. End of story.

but it wont be a variable when written


Who needs puzzles when we have AutoIt!!

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

You can't use a variable in the source. Ever. End of story.

Please explain :)

EDIT:

He means in file install. Look it up in the helpfile peeps. >_<

Edited by BrettF

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Yes it will. Look in the helpfile. It specifically states you can't use a variable for the source so don't even try. Even if you String() the expression it's still containing a variable and thus won't work.

FileInstall

--------------------------------------------------------------------------------

Include and install a file with the compiled script.

FileInstall ( "source", "dest" [, flag] )

Parameters

source The source path of the file to compile. This must be a literal string; it cannot be a variable.

Edit: Added helpfile line. Edited by dbzfanatic

Share this post


Link to post
Share on other sites

You can't use a variable in the source. Ever. End of story.

He's not. His script is creating another script where the variable will already be parsed into a literal string when written into the FileInstall() line of the new script.

To generate the formatted text and test it, try this:

; Simulated output of _FileListToArray()
Global $FileArray[3] = [2, "Test1.txt", "Test2.txt"]

; Loop to output generated FileInstall() script lines
For $n = 1 To $FileArray[0]
; Note double backslashes (see help file under StringFormat()
    $sString = StringFormat("FileInstall('Chrome\\locales\\%s', @TempDir & '\\%s')", $FileArray[$n], $FileArray[$n])
    ConsoleWrite($sString & @LF)
Next

:)


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

Share this post


Link to post
Share on other sites

Sweet guys, thanks! I think I finally got double quotes down. I will now present my Chrome Standalone Launcher in the Google Chrome thread!

Share this post


Link to post
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
Sign in to follow this  
Followers 0