Jump to content

noleghair

Members
  • Posts

    17
  • Joined

  • Last visited

Everything posted by noleghair

  1. i tracked it down some more and everything works just fine up until for $i=1 to 21 GUICtrlSetData($Combo[$i],$strData) Next for some reason it is not populating any of my lists. I tried GUICtrlSetData($Combo[1],"|1|2|3|4") and it still did not work. Anybody else have a problem with ctrlsetdata? Is there another way to do this? Thanks
  2. i have a script that reads from and writes to an access database. All of the files are located on a server 2003 server. It works fantastically in XP, but i wanted to be able to run it from the server via remote desktop. The script is not failing or giving me any errors, but its also not pulling the info or populating the lists (not sure where its failing) code to fill lists and get fields for later input: ;~ fill lists $query = "SELECT * FROM " & $tares global $tareoutput=_listdata($query, $db, $taredesc, $tareW) for $i=1 to $tareoutput[0][0] $strData = $strData & "|" & $tareoutput[$i][0] Next for $i=1 to 21 GUICtrlSetData($Combo[$i],$strData) Next global $fields = _FieldNames($db, $wastetable) functions: func _listdata($_sql, $_dbname, $_field, $_field2) $adoCon = ObjCreate ("ADODB.Connection") $adoCon.Open ("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & $_dbname) $adoRs = ObjCreate ("ADODB.Recordset") $adoRs.CursorType = 1 $adoRs.LockType = 3 $adoRs.Open ($_sql, $adoCon) $_count=$adoRs.RecordCount Global $_output[$_count+1][2] $_output[0][0]=$_count $r=0 With $adoRs If .RecordCount Then While Not .EOF $r=$r+1 $_output[$r][0]= .Fields ($_field).Value $_output[$r][1]= .Fields ($_field2).Value .MoveNext WEnd EndIf EndWith return $_output $adoCon.Close EndFunc Func _FieldNames($dbname, $tblname) $adoCon = ObjCreate ("ADODB.Connection") $adoCon.Open ("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & $dbname) $adoRs = ObjCreate ("ADODB.Recordset") $adoRs.Open ("SELECT * FROM " & $tblname, $adoCon) dim $name[$adoRs.Fields.Count-1] $name[0]=$adoRs.Fields.Count-2 For $i = 1 To $adoRs.Fields.Count-2 $name[$i] = $adoRs.Fields ($i +1).Name Next Return $name EndFunc ;==>_FieldNames Ive tried searching the forms and have not been able to come up with anything definative. Thanks for any suggestions you can give.
  3. i guess i didnt know file find next works on folders. thank you
  4. i have a folder on the network that i send new tasks to a couple of times a day. Each of the tasks are folders with a couple of files in them. In that root folder i also have an archive folder. What i would like to do is create a program that i would put in windows scheduler so at the end of every day it would run and it would take every folder that is not named "archive" and move it to the archive folder. i was thinking i would create either an INI or a text DB that would contain all of the folders i dont want to move and then check all of the folders contents against that list I have used filefindfirst and next to do the same thing with files before, how can i do it with folders? any help would be awesome.
  5. i have a peice of VBA im using in access to retrieve information from an Oracle ERP database and dump it into a "divisional" database The VBA is: Private Sub Command1_Click() Dim objConn As ADODB.Connection Dim objComm As ADODB.Command Dim objParam1 As ADODB.Parameter Dim objParam2 As ADODB.Parameter Dim objParam3 As ADODB.Parameter Dim objParam4 As ADODB.Parameter Dim objParam5 As ADODB.Parameter Dim objParam6 As ADODB.Parameter Dim strid As String Set objConn = New ADODB.Connection objConn.Open "Provider=MSDAORA.1;Password=XXXXX;User ID=XXXXX;Data Source=XXXX;Persist Security Info=True" Set objComm = New ADODB.Command Set objComm.ActiveConnection = objConn objComm.CommandText = "GET_DEPT_PROD_CNT" objComm.CommandType = adCmdStoredProc Set objParam6 = objComm.CreateParameter("RETURN_VALUE", adNumeric, adParamReturnValue) objComm.Parameters.Append objParam6 Set objParam1 = objComm.CreateParameter("P_CELL", adVarChar, adParamInput, 4000, "266070") objComm.Parameters.Append objParam1 Set objParam2 = objComm.CreateParameter("P_ICNT", adVarChar, adParamInput, 4000, "10") objComm.Parameters.Append objParam2 Set objParam3 = objComm.CreateParameter("P_PLIN", adVarChar, adParamInput, 4000, "1") objComm.Parameters.Append objParam3 Set objParam4 = objComm.CreateParameter("P_SHIFT", adVarChar, adParamInput, 4000, "D") objComm.Parameters.Append objParam4 ProdDate = Format(ProdDate, "d mmm yyyy") Set objParam5 = objComm.CreateParameter("P_DATE", adVarChar, adParamInput, 4000, lblDate.txt) objComm.Parameters.Append objParam5 objComm.Execute Label1.Caption = objParam6 Set objParam1 = Nothing Set objParam2 = Nothing Set objParam3 = Nothing Set objParam4 = Nothing Set objParam5 = Nothing Set objParam6 = Nothing Set objComm = Nothing Set objConn = Nothing Exit Sub errHandler: End Sub Where im using a stored procedure with some parameters to get the info that i need. Can anyone help me with exactly how i can do this in auto it? I tried setting up a connection in the administrative tools and using this GUI, but i failed miserably. Im not an autoit pro, but i am trying to learn Thank you for any help you can give
  6. What i am getting out of this is what i was trying to do is either not possible, or at the least not standard practice. Im thinking i will just use an ini file and get it over with. Thanks for the help. i will admit defeat for now. For future reference though, if anyone knoew how to read a text file that had 1,1a,1b,1c,1d,1e,1f 2,2a,2b,2c,2d,2e,2f 3,3a,3b,3c,3d,3e,3f 4,4a,4b,4c,4d,4e,4f 5,5a,5b,5c,5d,5e,5f and tell me how to read that into an array so i could call out 4d with something like "$VAR[4][5] that would be awesome Thanks
  7. still not what im after. I apologize if i am being unclear. lets pretend: i have a text file named "file1" that has the following contents: solitaire,"solitaire.exe" hearts,"hearts.exe" spades,"spades.exe" ; ~ and 100 more entries like that in this case, 3 lines and thats it, but it needs to be read from the file nonetheless. then i would have the following code (of sorts) Dim $aD If Not _FileReadToArray("file1.txt",$aD) Then MsgBox(4096,"Error", " Error reading log to Array error:" & @error) Exit EndIf ;~ formats file contents to create a list $DList="" For $x=1 to $aD[0] $Dlist = $DList & "|" & $aD[$x] Next ; ~ makes list and highlights the first entry $n2=GuiCtrlCreateList("", 255, 10, 235, 300,"LBS_NOTIFY | WS_VSCROLL | WS_BORDER") GUICtrlSetFont($n2,20,300) GuiCtrlSetData($n2, $DList, $aD[1]) $n3 = GuiCtrlCreateButton("RUN!!", 200, 305, 100, 30) GUICtrlSetOnEvent($n3,"fncRUN") func run() run( - array variable here- ) endfunc what i would want the program to do is display only the value of the first field in the record, but when you click run, it runs the program that is associated with that record. The records need to be in a text file and cannot be hard coded in any way. i dont know if that just complicated things even more, but i hope between the 3 posts it will make sense.
  8. no, sorry, i will try to explain better. Think of it in database terms. I want one file to hold all of my records, but each record has multiple fields, all delimeted by a comma ",". I want to read each field of each record into a multi dimentional array. so if i wanted to pull the information from the 1st field in the 4th record i could do that. with a call like (in no way is this correct) $value[4][1]. The specific use is i want to show only the first field of each record in a list, but when that 1 item is activated, the script will open the program in field 2 with the command in field 3 hope that makes better sense (and i hope its possible with a text document)
  9. What i have here is a script that reads the values of a 2 files and then and loads them into 2 arrays so i can use those arrays to populate 2 lists. After that i manipulate the lists and have all my fun. What im wondering is how i can read a single file into 2 different arrays (or a multidimentional array) that would allow me to do the same thing without having to have 2 files. The only constraint is that the parts have to be on the same line, so i cannot use section breaks and so on. also, i would like it to be impervious to missing parts of the line EG "line1a,line1b" would work, but so would "line1a," and ",line1b". If there is nothing there, it would just return an empty value Thank you #include <file.au3> #include <GUIConstants.au3> GUICreate("GUI",500,350,200,200) GUISetState (@SW_SHOW) Opt("GUIOnEventMode",1) Dim $aD If Not _FileReadToArray("file1.txt",$aD) Then MsgBox(4096,"Error", " Error reading log to Array error:" & @error) Exit EndIf Dim $aP If Not _FileReadToArray("file2.txt",$aP) Then MsgBox(4096,"Error", " Error reading log to Array error:" & @error) Exit EndIf $PList="" For $x=1 to $aP[0] $Plist = $PList & "|" & $aP[$x] Next $DList="" For $x=1 to $aD[0] $Dlist = $DList & "|" & $aD[$x] Next . . . . . $n1=GuiCtrlCreateList("", 10, 10, 235, 300,"LBS_NOTIFY | WS_VSCROLL | WS_BORDER") GUICtrlSetFont($n1,20,300) GuiCtrlSetData($n1, $PList, $aP[1]) $n2=GuiCtrlCreateList("", 255, 10, 235, 300,"LBS_NOTIFY | WS_VSCROLL | WS_BORDER") GUICtrlSetFont($n2,20,300) GuiCtrlSetData($n2, $DList, $aD[1]) . . . . . and so on
  10. GUICtrlSetFont (controlID, size [, weight [, attribute [, fontname]]] ) ...was exactly what i was looking for, not sure why i missed that. Thanks a bunch for your help
  11. i an writing just a fun program and i wanted to have a gui that would create a series of 7 labels, with the one in the center being a big font and gradually getting smaller as the go up and down. Then i was going to assign the values from an array and increment the labels so it looks like a spinning wheel (so to speak). The problem is, i cannot find any examples of how to have different size labels in a GUI. Any ideas? Thank you
  12. I want to have a script that is really boring It would sit all day long and watch to see if there are any additions to a folder and if so, prompts the user to see if they want to run another script to open and execute the list of newly added files. Any help would be greatly appreciated
  13. ok. again, i was being a complete idiot. Instead of trying to add text to the cmd.exe thing, i just hid it and added my own splash but it still would be nice to know how to do that.
  14. wow, so when i tried that the first 8 times it didnt work for some reason. I guess i just needed to be reminded. any ideas on adding text to the cmd.exe file running thing? this is my code right now btw if you want to try it(even though the file wont open for you): $ECN = int(InputBox("ECN VIEWER", "Enter the ECN number you want to view")) If @error = 1 Then MsgBox(4096, "Exiting", "Canceled, bye!") Else If $ECN<1 Then MsgBox(4096, "Error", "You must enter an ""actual"" ECN number!") $run=0 Else $run = 1 EndIf endif if $run=1 then $file = FileOpen("c:\ecn.rd2",2) If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf FileWriteLine($file, "ECN-" & $ECN) FileWriteLine($file, "SIGNATURE REQUEST: FALSE") FileClose($file) RunWait(@COMSPEC & " /c start C:\ecn.rd2") endif
  15. I am making an extremely simple script. It goes like this: Create a file Run the file So far the only way i have been able to create the file is by opening a new occurence of notepad, writing in the 2 lines of text, and saving it as my .rd2 file. Then i close notepad and open the file with: RunWait(@COMSPEC & " /c start C:\ecn.rd2") which does the job just fine. The big problem is all of that stuff with notepad cannot possibly be the best way to do that, and i have had no luck so far with anything else like FILEWRITE any ideas on how i can pull this off quickly without having to run notepad?(or anything else in the foreground for that matter) also, a bonus would be to be able to have a line of text in the shell that pops up to run the program that says something like "please wait for file to load" That would be sweet Thanks a ton
  16. Once you figure out all of the little things like "how do i program". The general theory behind a script that plays poker is that you read a brain (a trainer program of some sort; holdem inspector, etc) and use its logic command the poker screen. a general script would be: when its my turn call function ACTION() do what action tells me (press one of the 3 buttons) ACTION() find out what brain says now on my script i became more creative with things like switching tables after so long or if participation dropped below a certain point i refuse to be too specific because i long since have given it up since it cheapens the game tremendously, and if you need it to win, you shouldnt play anymore
×
×
  • Create New...