Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/04/2012 in all areas

  1. Not the fanciest thing in the world but it's very helpful while I'm debugging some of my programs. Displays wither the input variable was an Array or Variable, Tells you the line number as well as variable name, and displays contents either in msgbox or _arraydisplay #include #include $Example = 'Hello World' Test($Example) Dim $ExampleA[3] $ExampleA[0] = 2 $ExampleA[1] = 'Hello' $ExampleA[2] = 'World' Test($ExampleA) Func Test($iVar = '', $iLine = @ScriptLineNumber) If IsArray($iVar) Then $xBetween = _StringBetween(FileReadLine(@ScriptFullPath, $iLine), 'Test(', ')') $xBetween = $xBetween[0] _ArrayDisplay($iVar, 'Array: ' & $xBetween & ' Line: ' & $iLine) Else $xBetween = _StringBetween(FileReadLine(@ScriptFullPath, $iLine), 'Test(', ')') $xBetween = $xBetween[0] MsgBox(0, 'Variable: ' & $xBetween & ' Line: ' & $iLine, $iVar) EndIf EndFunc ;==>Test
    1 point
  2. Howdy -- I'm a long time AutoIt user, and I've put it to use when rendering shots for a 3D animated music video movie I'm working on. I gave a talk last week about the process of creating the movie, and started showing the AutoIt related stuff around the 23 minute mark: http://www.youtube.com/watch?v=sY4ZDgQ3O1c Anyway, thought you might find this to be an interesting sort of use for AutoIt. Jeff Boller http://www.simplecarnival.com http://www.facebook.com/TheSimpleCarnival http://twitter.com/simplecarnival
    1 point
  3. Since I started using AutoIt, I always thought the help file example for using StdOutRead and StdErrRead was the only way to read the StdOut and StdErr streams of a program being executed. I ran across an example from another user that showed that these streams do not need to be read in a loop while the program is running, but that they can be read even after the program has closed. I've modified the example script shown in the help file to show what I'm talking about. ; This is the example script from the help file slightly modified to use ConsoleWrite instead of a MsgBox #include <Constants.au3> Local $foo = Run(@ComSpec & " /c dir foo.bar", @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) Local $line While 1 $line = StdoutRead($foo) If @error Then ExitLoop ConsoleWrite("STDOUT read: " & $line & @CRLF) WEnd While 1 $line = StderrRead($foo) If @error Then ExitLoop ConsoleWrite("STDERR read: " & $line & @CRLF) WEnd MsgBox(0, "Debug", "Exiting...") ; This is the same example of reading StdOut and StdErr but without using a loop. ; this example shows no blank lines in the output text. Local $foo = Run(@ComSpec & " /c dir foo.bar", @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) While ProcessExists($foo) Sleep(10) WEnd $line = StdoutRead($foo) ConsoleWrite("STDOUT read: " & $line & @CRLF) $line = StderrRead($foo) ConsoleWrite("STDERR read: " & $line & @CRLF) The second example shows that these streams are still able to be read even after the Run command program has exited, in fact the way it's written, they're not read until it has exited. You'll also notice that the output from the second example doesn't have the numerous blank lines that the first example shows. While this method may not be the officially approved way of reading the streams, and won't work for any script that needs to read these in real time, it should be mentioned that it's possible to do it this way in the help file, because I never knew that you COULD read them this way.
    1 point
  4. You could also take a look at the Outlook.au3 UDF.
    1 point
  5. Are you using WinAPIEx.au3?
    1 point
  6. Sounds like there's more than one file that sets the variable, find out which one is causing the error rather than bandaiding a fix. There's probably a file that didn't get updated when you installed the newer version.
    1 point
×
×
  • Create New...