title: AutoIT, print Array output to text file
body: <p>This is my first ever post on Stackoverflow! any help would be much appreciated.</p>
  
  <p>Im an AutoIT beginner and trying to create a script that takes a string, converts it to ASCII and saves it in an array using <strong>StringToASCIIArray</strong></p>
  
  <p>What i would like to achieve is that, i need the output to be printed in a text file, so i can copy it for later use.</p>
  
  <p>Ive tried using <strong>ConsoleWrite</strong> Function, the characters get printed just as i expect them to be, however it would nice if someone could point me out in the right direction to have them printed in a new text file or something. Thanks!</p>
  
  <p>Here's the code:</p>
  
  <pre><code>#include &lt;MsgBoxConstants.au3&gt;
  #include &lt;Array.au3&gt; 
  
  Test()
  
  Func Test()
  ; Convert the string to an ASCII array.
  Local $aArray = StringToASCIIArray("Hi, this is a new string")
  Local $sizeArr = UBound($aArray)
  
  For $i = 0 to $sizeArr - 1
      ConsoleWrite("Chr(" &amp; $aArray[$i] &amp; ")" &amp; " &amp; ")    ; need this output     in a new variable?
  Next
  
  ;Run("notepad.exe")
  ;WinWaitActive("Untitled - Notepad")
  ;Send($aNewArray)
  EndFunc   
  </code></pre>
  
  <p><strong>Update</strong>
  I managed to do it by creating a console application that takes an input string, converts the input to ascii and displays the formated output on the console. I can simply copy the output from there on....Not the best solution though, but it works :)</p>
  
  <p>Code::</p>
  
  <pre><code>#include &lt;MsgBoxConstants.au3&gt;
  #include &lt;Array.au3&gt;
  
  myexample()
  
  Func myexample()
  
   Local $sInput
   While True
      $sInput &amp;= ConsoleRead()
      If @error Then ExitLoop
      Sleep(25)
  WEnd
  
  Local $aArray = StringToASCIIArray($sInput)     ; store string to array
   Local $sizeArr = UBound($aArray)       ; Get array size
  
  For $i = 0 to $sizeArr - 1               ;For each element of array Do:
  ConsoleWrite("Chr(" &amp; $aArray[$i] &amp; ")" &amp; " &amp; ") ;write to console ascii in Chr() 
  Next
  
  EndFunc
  </code></pre>