jslegers Posted September 15, 2008 Posted September 15, 2008 Hi, I have the following code : $var1 = String ( '"' & @ScriptDir & "\new_1.log" & '"' ) $var2 = FileReadLine ( $var1, 2 ) MsgBox ( 4096,"Test",$var2 ) It looks like that FileReadLine can't read filenames with a path between quotes. Files are placed for test : c:\Documents and Settings\JSL\My Documents\Autoit Scripts\Log file\var.au3 Is this a limitation of FileReadLine ?
jokke Posted September 15, 2008 Posted September 15, 2008 (edited) Try with this instead: $file = FileOpen(@ScriptDir & "\new_1.log", 0) $var2 = FileReadLine ($file,2) MsgBox (4096,"Test",$var2 ) Edit: did not see that you had used string there. Edited September 15, 2008 by jokke UDF:Crypter a file encrypt / decrypt tool with no need to remember a password again. Based on Caesar cipher using entire ASCII Table.Script's: PixelSearch Helper, quick and simple way to create a PixelSeach.Chatserver - simplified, not so complicated multi-socket server.AutoIT - Firewall, simple example on howto create a firewall with AutoIt.
jokke Posted September 15, 2008 Posted September 15, 2008 Why do you need to qoute the string ? As you are only using it to inn the FileReadLine()? UDF:Crypter a file encrypt / decrypt tool with no need to remember a password again. Based on Caesar cipher using entire ASCII Table.Script's: PixelSearch Helper, quick and simple way to create a PixelSeach.Chatserver - simplified, not so complicated multi-socket server.AutoIT - Firewall, simple example on howto create a firewall with AutoIt.
PsaltyDS Posted September 15, 2008 Posted September 15, 2008 Hi, I have the following code : $var1 = String ( '"' & @ScriptDir & "\new_1.log" & '"' ) $var2 = FileReadLine ( $var1, 2 ) MsgBox ( 4096,"Test",$var2 ) It looks like that FileReadLine can't read filenames with a path between quotes. Files are placed for test : c:\Documents and Settings\JSL\My Documents\Autoit Scripts\Log file\var.au3 Is this a limitation of FileReadLine ? Don't save the quotes as part of the file path, and only add the quotes where you have to: $var1 = String (@ScriptDir & "\new_1.log") $var2 = FileReadLine ( $var1, 2 ); no quotes Run('notepad.exe "' & $var1 & '"'); added quotes 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
trancexx Posted September 15, 2008 Posted September 15, 2008 I need to use the quotes.Fight it!...you can do it ♡♡♡ . eMyvnE
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now