Jump to content

bartekd

Active Members
  • Posts

    156
  • Joined

  • Last visited

Everything posted by bartekd

  1. I am trying to make a gui with a couple digital clocks in it, that each have a different time zone. I looked on the forum, and all I see is complicated gui pretty analog clocks. Is there a basic way to display the current time in another time zone? If someone could point me to the right direction of one clock with time zone support, I will expand it to have a couple clocks which each have their own time zone. it would be better to have the seconds refresh realtime (while loop).
  2. Ah, antivirus, that makes sense. Is there any way around it?
  3. Does anyone notice that any folder that has autoit script EXE's in it, takes forever to open? It seems like it takes a while, and freezes windows explorer for a minute or 2 (dpeneding on how many EXE's are in that folder that were created by autoit). I have tried this from a networked drive (Server) and off the local C drive, all the same. Also all the computers I tried this on, it was the same thing.
  4. Thanks allot, this works beautifully.
  5. Its part of the SQL Server 2000 install. Is there a way to format this field in an array like the above?
  6. I am using ChrisL's _sql.au3 function. I have one issue with the Array and listView. When I run a particular query, it always removes all the spaces, colons, and dashes. Is there a way that it could be formatted better? Just so you know what I am talking about, here is an example of the same query I ran using Autoit and Query Analyzer. Results in Array [0]|1st Dial [1]|20090415153030 Results in Query Analyzer 1st Dial ------------------------------------------------------ 2009-04-15 15:30:30.000 Thanks in Advance
  7. Nevermind, I figured it out. For each line, I just replaced @crlf, @cr and @lf with "". That seems to work. $StationNow = $i1[$i2] $StationNow = StringReplace($StationNow, @CRLF,"") $StationNow = StringReplace($StationNow, @CR,"") $StationNow = StringReplace($StationNow, @LF,"")
  8. I have one small issue. The script isn't working if I am doing it for multiple computers that I am pulling from the log file. So instead of a msg box, i outputed the results of the computer name to a txt file. What I see is a small little square next to each of the computer names (each line in the edit) except for the last line. What I suspect is that each enter is putting something after the computer name. Any ideas on how to remove this?
  9. actually, you were right, instead of using @crlf, use either @cr or @lf. Thanks allot for your help, its much appreciated.
  10. Almost perfect. the only issue now is there is a extra enter between each space. For exmple my edit is wk001 wk002 wk003 and the array shows wk001 wk002 wk003 and the msg box would be, 'wk001' '' 'wk002' '' 'wk003' '' etc, you know why that would be?
  11. Nice, that almost works. There are 2 things, I had to put GUICtrlRead($EDIT1) otherwise it didn't return any data. also, for some reason even though there are more then one line in the edit, it just returns the first line, over and over again.
  12. In the loop, what I want to do is this. What is written on the line, I want to make a variable = that line. For example if in the edit this is what is there. WK001 WK002 WK003 WK004 First it will do the first line. So $Computername = 'WK001' after that, it will go to the next line, where $Computername = 'WK002' ETC... See what I mean?
  13. gives me the following error => Subscript used with non-Array variable.: For $i2=1 to $i1[0] For $i2=1 to $i1^ ERROR
  14. thanks, but now how do i loop each line of the edit?
  15. OK, so I am creating a psexec gui from scratch (I know there are a couple on this forum, but i want to create my own). as you probably know, you can make the script reference a computers.txt file and run it against those computers. This is what I wanted to do instead Create a gui control edit so I can put the list of computers in this edit and it will run one at a time. (I can use the runwait command and put the full command line for PSEXEC for each computer name) I already have created teh GUI that has a Input box that I use for one computer. But instead I would prefer to use a Edit and run it for multiple computers on just one depending on how many lines are in the edit. I have looked at the help file and was thinking of creating an array that is created from the data in the edit. Then I would loop from this array and for each computer. If any one has a way to do this, or any suggestions, please let me know. thanks in advance
  16. YAY, I figured it out. If anyone is curious, this is what I ended up with that worked. $done = "'" For $r = 0 To UBound($aData) - 1 For $c = 0 To UBound($aData, 2) ; $r = row, $c = column $sTemp = $aData[$r][0] & "|" Next $sTemp = StringTrimRight($sTemp, 1) $done = $done & "','" & $sTemp ;MsgBox(1024, "Row " & $r, $sTemp) Next ClipPut($done & "'") I added the above after my code, and it works like a charm. Thanks everyone, especially Valuater for all the help.
  17. Any one else out there help out? Am I using the array correctly, and is it in the right place? thanks,
  18. Here is the script that I am using. I have shortnened it so that it is easier to read as to what I am trying to do. #include <array.au3> #include <_sql.au3> _SQLRegisterErrorHandler();register the error handler to prevent hard crash on COM error $con = _SQLStartup() If @error then Msgbox(0,"Error","Error starting ADODB.Connection") _SQLConnect(-1,"SV50016","rogers_ret",USERNAME,Password) if @Error then Msgbox(0,"",$SQLErr) $Query = "select dispo from sv50016.gemmareports2.dbo.tbldispocamp where rpc = '1' and campaign_name = 'ROGERS_RET'" $data = _SQLExecute(-1,$Query) $aData = _SQLGetData2D($data) If NOT @error then For $i = 1 To $aData[0][0] $aData[$i][1] = StringReplace($aData[$i][1], @CRLF, ',') ; or "','" Next ClipPut($aData) _arrayDisplay($aData) Else Msgbox(0,"Error",$SQLErr) Endif _SQLClose()
  19. Does anyone know why it would not be working? I can provide more code if anyone wants to see what I am doing. Or does anyone else have a solution to this? I have an array that looks like this [0]|dispo [1]|A01 [2]|A02 [3]|A03 [4]|A04 [5]|A05 And I want for it to look like this A01','A02','A03','A04','A05 (I would have a variable equal the above so that I can use the data, and not have it in a array) But there somethimes could be more than 5 in the array. thanks in advance.
  20. Ya I tried it, but its not working. I even tried this with replacing the 'A' with a 'G' to see if it would work, and the same data is displayed in the array. It is a 2d array. I think I need to take it out from an array (its only one column that I need to extract). Once I have a variable that has all this data, I can use the string replace.
  21. Which variable would be the final variable that would have A01','A02','A03 etc...? CODE: AutoIt For $i = 1 To $var[0][0] $var[$i][1] = StringReplace($var[$i][1], @CRLF, ',') ; or "','" Next
  22. I have one more question with an array. I have an query that returns a different ammount of rows, and I want to be able use this data in another query that will run just after. So what I want to do is replace @CRLF with ',' so it will look like A01','A02','A03','A04' etc... The problem is that the amount of rows returned is always different depending on what I run it against. Any ideas? [0]|dispo [1]|A01 [2]|A02 [3]|A03 [4]|A04 [5]|A05 [6]|B01 [7]|B02 [8]|B03 [9]|B04 [10]|B05 [11]|B06 [12]|B07 [13]|B08 [14]|B09 [15]|B10 [16]|B11 [17]|B12 [18]|B13 [19]|B14 [20]|B15 [21]|B16 [22]|B17 [23]|B18 [24]|B19 [25]|B20 [26]|B21 [27]|SAL
  23. INstead of the part that opens notepad, then waits for it, then outputs it all into notepad and saves it. This would be also better because it could run in the background, and would save automatically. Just a though. Your way works too, just if someone clicks off the screen for a second, it will screw up the script.
  24. Why don't you make it run behind the scenes instead of opening notepad. Something like this: $file = ("c:\Compinfo.txt") $file2 = FileOpen($file, 1) FileWriteLine($file, $text1) FileClose($file) Run("notepad.exe "&$File) OR, this will probably work: $file = ("c:\Compinfo.txt") $file2 = FileOpen($file, 1) FileWriteLine($file, $text1) FileWriteLine($file, $text2) FileWriteLine($file, $text3) FileWriteLine($file, $text4) FileWriteLine($file, $text5) FileClose($file) Run("notepad.exe "&$File)
  25. Woa, all that searching, and I have been thinking about this all weekend, and its that simple. Thanks allot. I used this $Info = $aData[1][0] Thanks again, sorry for posting something so easy.
×
×
  • Create New...