Jump to content

ndw

Active Members
  • Posts

    26
  • Joined

  • Last visited

Profile Information

  • Location
    UK

ndw's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Thank you to both of you for your suggestions. I'll get reading through them to try and get my head round them!
  2. Hello, this isn't a specific coding question and more a fact finding exercise! I'm writing a script with a command line interface that opens up an application and performs regression testing on it. It takes pictures of the application and i use an image difference application to find the results. This is all working fine so long as the pictures are there. The problem i'm finding is, if something goes wrong with the program, it can pop up an error message box which i have no idea how to constantly check for, or after clicking something nothing happens cause the application has frozen. I've had the application close down completely and the AutoIT script take my desktop to pieces too. I wanted to know if anyone has any solutions, maybe using the software for a similar task to what i'm using it for etc?
  3. Thats great. Got it in there, compiled and works nicely now. Thank you to you both
  4. Sorry to be a pain but i don't understand what i need to do with this. With StdInWrite, i'm confused about the "child process" bit. Sorry for sounding like a noob but, is that asking for the process id of the command window that launched the program? From what i can see, it looks to be used for if i run something within my script, but i'm running an .exe version of my AutoIT script, not a command window from within it. What i'm doing is running my AutoIT script from the command line which i would like to pass some switches in eg AutoITScript.exe -spath "C:\blah\blah" -v -p 46 And to that command window, i want to output if a switch has incorrect data like -v wasn't specificed. Ugh, i'm confusing myself with this, i can explain it again if it's unclear.
  5. After replacing the batteries in this keyboard, i really want another go at typing that horrible title again... Thank you for your reply, i'll look in to this now.
  6. Hello. I found created a long time ago of exactly the thing i'm trying to do, but its resolution isn't working for me. I would like to write some text back to the commandline that executed my compilied AutoIT script. Nothing complicated and i did a search and found ConsoleWrite. My code currently looks like this but, nothing is written back in to the cmd window. Case $CmdLine[$i] = "-spath" If $i == $CmdLine[0] Then ConsoleWrite("-spath requires a path to be specified" & @CRLF) Msgbox(0,"Test", "-spath requires a path to be specified") Exit Endif So when -spath is not supplied with a path to a file, it writes back to the cmdline "there was no path". The msgbox is just there to show me it's got to the right part of the code.
  7. Well when you do a search when you already know the answer, it does show a few results doesn't it? Thanks for the help.
  8. Hello there, i'm surprised i've not found a topic on this in my searches because i thought it would be common! I would like to get ahold of the system time and date of the computer i'm using. My plan is to use this for a folder name thats unique, i.e. YYMMDDHHMMSS. Are there some functions that can capture this data? Thank you.
  9. Thats it thank you. When i saw that, i thought it was regarding other things that could be considered data, since all the other controls in the list use Caption rather than Text for their display. Thank you!
  10. If there is a way to use that to remove the current text and rewrite it, yes. I've looked at the Help page on that and i couldn't see how it could be used (for what i want*).
  11. Hello, this should be a very simple and straight forward question. I have a FileOpenDialog that, when it has a filepath entered, will write the path into an Input box. Looking at the set functions associated with an Input box, there is no GUICtrlSetText or something similar. Could someone point me at an example of help file that can help me?
  12. Also, i've put this in to the wrong forum. I think this would be better suited being in the general help. If this could be moved, would be much appreciated.
  13. Oh ok, i thought there might be some issue with editting somebody else's work or something silly but i'll look in to the after, it's working just not exacting as i want it. More concerned about the Call function and how to tackle that
  14. I've managed to work myself a mountain out of a mole hill on this one. I've written out some code to show what i'm trying to do. The issue i have is determining how many arguements there are. I have some Functions that don't require any parameters, and others that have a few. I don't know of a way to make it able to handle any number of parameters. Local $textfile, $i, $text, $array, $num1, $num2 $textfile = FileOpen("textfile.txt") $num1 = Random(0,10) $num2 = Random(0,10) For $i = 1 to _FileCountLines("textfile.txt") $text = FileReadLine($textfile,$i) ; Format of text in file "Addition;$num1;$num2;7", but some functions have no arguements $array = StringSplit($text, ";") ; This would call a function with no arguements ; Call($array[0]) ; But how would you call a function when you don't know how many arguements there are? Call ($array[0], $array[1]) ; $array[2] etc.. Next Func Addition ($a, $b, $c) Msgbox (0,"Number", $a+$b+$c) EndFunc I hope i've made this clear enough. I was stuck on the _FileCountLines for a while till i realised it was cause i was using the file handle when it can only deal with the path, which is a shame.
  15. I have this working now for my functions that don't require arguements, but for something that does require arguements, i guess i'm gonna have to do something clever? In the file, let's say i have a some text that says "Reposition($x,$y,20,20)" where $x and $y are integers already definied earlier in the script. Do i need some kind of method that will break down the string in to characters, and stop at "(" ")" and "," and start cutting up the string to an array? Currently using FileReadLine.
×
×
  • Create New...