godsstigma Posted January 18, 2009 Posted January 18, 2009 I am trying to combine two variables into one variable separating the two with a single character like "\". Here is my sample script: #include <file.au3> $folderselect = FileSelectFolder("Select folder that contains files you wish to write to an array","@DesktopDir", 7) $filelist1 = _FileListToArray($folderselect, "*.*", 1) $file = FileOpen("c:\Test Array.txt", 2) _FileWriteFromArray($file, $filelist1) fileclose($file) $file2read = FileOpen("c:\Test Array.txt", 0) $readfile = fileread($file2read) MsgBox(1, "Contents of File", $readfile) $readline = FileReadLine($file2read, 6) I want $folderselect and $readline to be combined separated by "\" ...basically getting the full file path to use later. Thanks -John
BrettF Posted January 18, 2009 Posted January 18, 2009 What you're looking for is String Concatenation. In AutoIt, the operator is the & character. See the following example: $var3 = $var1 & "\" & $var2 Cheers, Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
liteswap Posted January 18, 2009 Posted January 18, 2009 (edited) I am trying to combine two variables into one variable separating the two with a single character like "\". Here is my sample script: #include <file.au3> $folderselect = FileSelectFolder("Select folder that contains files you wish to write to an array","@DesktopDir", 7) $filelist1 = _FileListToArray($folderselect, "*.*", 1) $file = FileOpen("c:\Test Array.txt", 2) _FileWriteFromArray($file, $filelist1) fileclose($file) $file2read = FileOpen("c:\Test Array.txt", 0) $readfile = fileread($file2read) MsgBox(1, "Contents of File", $readfile) $readline = FileReadLine($file2read, 6) I want $folderselect and $readline to be combined separated by "\" ...basically getting the full file path to use later. Thanks -John $newvar = $folderselect & "\" & $readline It's all in the helpfile.... Edited January 18, 2009 by liteswap
godsstigma Posted January 19, 2009 Author Posted January 19, 2009 Thanks to both of you, I knew it was in the help file I just couldn't find it. Now that I know what to search for I should be fine... thanks again!!!
godsstigma Posted January 19, 2009 Author Posted January 19, 2009 Thanks to both of you, I knew it was in the help file I just couldn't find it. Now that I know what to search for I should be fine... thanks again!!!
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