Jump to content

andyswarbs

Active Members
  • Posts

    55
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

andyswarbs's Achievements

Wayfarer

Wayfarer (2/7)

0

Reputation

  1. I have got into using this quite extensively. However some calls fail and some succeed. This is in a For...Next loop so it is unlikely to be a syntax error on my side. Also I have trapped the failure on a variety of other calls. Essentially the first one or two calls to the RUN function when $STDOUT_CHILD etc is specified works fine, and mostly the second one works. But the third, or 4th become dodgy. At one point I thought I had this down to every alternate call would fail, but it is not that simple. I was musing that there might be a race condition, such that my code: $Pid=Run($Cmd,$Dir,$Flag,$STDERR_CHILD+$STDOUT_CHILD) While True $OutText=StdoutRead($Pid) If @error=-1 Then ExitLoop $OutTextAll &= $OutText WEnd While True $ErrText=StderrRead($Pid) If @error=-1 Then ExitLoop $ErrTextAll &= $ErrText WEnd might fail because Run is an independent process. Further exhaustive tests show that there is a real runtime problem here. I have tried using processclosewait() on my PID, to no avail. Has anyone any insights? Right now I have put a loop saying "have I retrieved the data (since I knowit exists), if not then re-run the RUN command and get the output again! Not ideal obviously. Andy
  2. Can I ask fora point of clarification on the following: Version 1: $X=1 IF $X=0 and Z() Then Exit Endif My question "Is the function Z ever evaluated?". This is important since Z may be time-consuming. So a more laborious bit of code but safer, might be: Version 2: $X=1 If $X=0 Then If Z() Then Exit Endif endif But is the latter necessary? And is Version 1 a happenstance, or (my ideal answer) intentional in the language. I how safe am I in using version 1. Regards Andy
  3. If you check the helpfile regarding operators you will see that both = and == can be used for testing strings - but the results may be different. = Tests if two values are equal (case insensitive if used with strings). == Tests if two values are equal (case sensitive if used with strings)
  4. www.autoitscript.com/autoit3/scite/ (imo) provides you with the most amazing and powerful development environment for au3.
  5. If you follow through my signature you will be able to collect other the other library components. Let me know if that is a problem.
  6. There is a 3rd party tool called SetLocale that may help. Get a copy at http://www.spectrodisplay.nl/download/setlocale.zip
  7. Jdeb, thanks for coming back on this - much appreciated. Your example works just fine. I am trying to extend the example to make sure I really understand what is going on and why I did not understand it better before. If I get somewhere with something useful I will post back here.
  8. John, I have just posted an update at http://www.autoitscript.com/forum/index.php?showtopic=21542 which I believe addresses your issues.
  9. I suspect that actually the code is not doing anything useful. Please prove me wrong!
  10. There are some programs that need to support complex command line options. If that's you then you might find this library useful. This library provides a structured parsing of command lines with additional support for setting default values in the registry. To call the routine you describe your command line in an (N+1)x3 array, where N is the number of arguments. On return any argument that is recognised has index 1 set to that value. If a parameter to the argument is required then index 2 has that value. Normal command line argument rules apply, with the following additional guidelines. Positional arguments are supported and must occur before all optional argumemts. Optional arguments are prefixed with either a '-' or a '/'. Positional arguments must be space separated (with required spaces must be embedded in quotation marks). This routine is useful when your command line is becoming complex & powerful. The automatic registry support makes the implementation very powerful. Up to two registry locations are supported: typically you c/would use one for HKCU (user defaults) and another for HKLM (computer defaults). (Warning: This tool is in alpha state - so do not expect perfection - thanks in advance to those who try. My goal is to extend validation & rigour, eg to ensure a filename is valid and that parameters to arguments are properly specified.) PopG_CmdLine.au3
  11. Yep, I was trying to get rid of whatever was causing that glitch, and probably the answer I came up with is not correct. Time for another play. But it still does not solve the core problem of why the stringlen>0 does not work and why stringlen>1 does. At the time I felt that it was a bug in Au3, but it could be my ignorance elsewhere.
  12. See my Run into an array etc and I think you will feel happier.
  13. It indeed does do what it says "on the box". I would appreciate someone helping debug the code regarding StringLen. If StringLen($TmpVal)>1 Then _ArrayAdd($rwoeOutArr,$TmpVal);should be >0 but some bug there! **************************** What the hell is going on there is a mystery to me. I tried to see if there were any control chars, and there weren't. So I do not know, and that's the truth.
  14. It is my continued intention to publish all my core libraries under GPL. UserCallTips: If you want to you can load the contents of PopG_au3.user.calltips.api.txt into file "au3.user.calltips.api" in "C:\Program Files\AutoIt3\SciTe\api" to extend Scite4Au3 to CallTips knowledge about this library.
  15. I'm gonna get my head round this.
×
×
  • Create New...