
randym
Active Members-
Posts
35 -
Joined
-
Last visited
randym's Achievements

Seeker (1/7)
0
Reputation
-
Attempting to implement Null Dates in my script
randym replied to randym's topic in AutoIt GUI Help and Support
Thanks for the responses to this topic .... Nine - your suggestion works perfectly for me and fits well with my existing code. Again, thanks! -
Attempting to implement Null Dates in my script
randym posted a topic in AutoIt GUI Help and Support
I have a user request to be able to optionally leave a date field blank or otherwise null it out ... Research led me to the $DTS_SHOWNONE style that looks promising ... I created a test script and implemented it, but perhaps I don't have the usage exactly right ... I get the checkbox that seems to enable and disable the field, but the contents remain the same .... Am I missing something? My test script is included below. TIA - Randy Date_Test.au3 -
I was reading the FAQ's regarding decompiling and I completely get it.... Without getting into finger pointing, I find myself in the position of needing decompiling. You state in FAQ's that your developers may choose to decompile at their discretion and proof of ownership will be required. My question is, what form of documentation constitutes adequate proof? I realize this is a general question and case by case, specifics may vary. - Randy
-
I am working on a project automating data entry into an application. For this particular phase, I have need to activate a button control in certain instances, but only if it is enabled. Can anyone give me any clues how to determine the state of a windows screen control? Thanks, Randy
-
Background - I have developed a few AutoIT scripts that I have compiled and have been working just fine. Recently, the development machine I was using died and I had to move development to another workstation - both were and are Win 7 Pro 64, if that matters. I downloaded the latest AutoIT install and went through the process, managed to recover my .au3 files from backup and things looked very good. Today I had a support issue with one of my scripts and went through my debugging process. I ran my debugging process from the SciTE editor and uncovered and corrected the problem. Now I want to recompile the script into an 'exe' for general use. I attempted this from within SciTE using menu 'Tools' -> 'Compile' All looks normal, all paths are correct and accessible, however I get an unable to add resources error... Screen shot of complete error attached. I am running as administrator, but that makes no difference. I can only think it has something to do with permissions or configuration, but have run out of ideas. Does anyone here have any ideas? Thanks, Randy
-
ADODB Proper Closing - Memory Release
randym replied to randym's topic in AutoIt General Help and Support
mLipok - I have been playing with your GetRows() suggestion and I like it. Just wanted to let you know. I haven't been able to demonstrate any speed advantages yet, (my test data is somewhat limited), but that is just icing on the cake. I should be able to get a better idea tomorrow when this is unleashed on the troops. As for the memory issue - at this time of day, the io service would be tying up several hundred meg of memory, typically. Today - less than 19K Thanks again for helping me put this to bed. I am looking forward to my next project that will more fully exercise SQL execution and return sets of data. -
ADODB Proper Closing - Memory Release
randym replied to randym's topic in AutoIt General Help and Support
I was not aware of that method... Thanks for the tip! -
ADODB Proper Closing - Memory Release
randym replied to randym's topic in AutoIt General Help and Support
Sorry for the confusion... I was referring to the changes to the actual live executables that are built using this function, not these little test scripts. As it turns out, the combination of Waters suggestion and yours has had a positive impact on this issue. Only creating the adoCon object once and closing it once does seem to use far less resources. Testing looks very promising. I have just completed changing a number of executables in this way and compiling for end user use. I will monitor things and let you know how it goes. Thanks to both you and Water for your assistance in this matter. -
ADODB Proper Closing - Memory Release
randym replied to randym's topic in AutoIt General Help and Support
Water - I can give your technique a try and see how it goes.... mLipok - It would require some fairly significant surgery on my process to open and close only once, but it might be worthwhile.... I will test Water's suggestion first though. As each line is processed and validated, the memory usage ramps up and once the process completes it remains where ever it is. The usage does not go down. Although the test script is not compiled, the full live process is compiled and I have seen no difference in this issue from compiled to not compiled. -
ADODB Proper Closing - Memory Release
randym replied to randym's topic in AutoIt General Help and Support
mLipok - OK - added the Null statements to the script below... Global $Mas_Cust = '010000047' Validate_Cust() Func Validate_Cust() ; ODBC System DSN definition $DSN = "DSN=Charm"; database as defined in ODBC $adoCon = ObjCreate("ADODB.Connection") $adoCon.Open($DSN) $adoRs = ObjCreate("ADODB.Recordset") ; Create a Record Set - SELECT SQL ; create the SQL statement $adoSQL = "SELECT AR_Customer.ARDivisionNo, AR_Customer.CustomerNo, AR_Customer.CustomerName FROM AR_Customer AR_Customer WHERE (AR_Customer.CustomerNo='" & StringMid($Mas_Cust, 3) & "')" ;MsgBox(0, '', $adoSQL) $adoRs.CursorType = 2 $adoRs.LockType = 3 ; execute the SQL $adoRs.Open($adoSQL, $adoCon) $found = 0 With $adoRs $dimension = .Fields.Count If .RecordCount Then While Not .EOF For $i = 0 To .Fields.Count - 1 Switch $i Case 0 $div = .Fields($i).Value Case 1 $cust = .Fields($i).Value Case 2 $name = .Fields($i).Value $found = 1 EndSwitch Next .MoveNext WEnd EndIf EndWith If $found = 1 Then MsgBox(0, 'Debug', "Found " & $div & '-' & $cust & ' ' & $name) Else MsgBox(0, 'Debug', "Not Found " & $Mas_Cust) EndIf $adoRs.Close ; close record set $adoCon.Close ; close connection $adoRs = Null $adoCon = Null EndFunc ;==>Validate_Cust Unfortunately, my testing does show this has had any impact on the issue.... I am sending three screen shots of the memory usage of the pvxiosvr.exe service. First is prior to any tests and with minimal users on the system and NONE of them running AutoIT in any capacity. The next screen shot is from immediately after the test VBS script has been run. And finally, after the script listed above has been run. Also, the memory size grows with each iteration of validation executed, so if I attempt to validate a set of data with 500 lines in it, 4 or 5 validations per line, the memory usage can easily grow into the GB range and left unchecked, will cause our server to crash. Stopping and starting the service will release the resources, but is a band aid to the problem. -
ADODB Proper Closing - Memory Release
randym replied to randym's topic in AutoIt General Help and Support
I will try the 'Null' statements. I downloaded and installed latest AutoIT on Windows 7 Pro 64bit machine in the last 6 weeks or so... I have not looked for another one. I did not compile as 64 bit. No updates to Providex. Manual for syntax at http://docs.pvxplus.com/PVXV7.pdf This is a server side ODBC service that the workstations connect to through their DSN ... I have attached the installation and configuration documentation in the interest of completeness. Since this service is server sided and all workstations connect to it from time to time, I expect it to use server resources during execution and release them upon termination. Since the service is on the server, I do not see any way to get the client workstations to report on memory usage. ConfigureClientServerODBCDriver.pdf -
ADODB Proper Closing - Memory Release
randym replied to randym's topic in AutoIt General Help and Support
Server Type - Windows 2003 Server It is not MS SQL - It is Providex I think this is unexpected because this application has been running on this server for many years and has not had this particular issue ever. The ODBC io service on the server (pvxiosrv.exe) that provides read only data grows in memory size as these scripts are run. I am attempting to document the memory growth of the service when these processes are run, however it is difficult as this is a live server. I will attempt to capture some screen shots to document this growth over the weekend. The DSN is used constantly by Crystal reports which is the primary reporting mechanism in this application and I use the DSN through Excel quite frequently for adhoc queries and these issues do not occur. I have created a small test AutoIT script that simply validates a single customer and have duplicated that functionality in VBS to attempt to document the memory growth issue. They are included in this email, but likely, you do not have a similar Providex environment for testing on your end. Let me know if there is anything on this end I can do to assist.... Thanks, Randy 'VBScript ado testing Dim DSN, adoCon, adoRS, adoSQL, myfound, i, div, cust, name, Mas_Cust DSN = "DSN=Charm" Mas_Cust = "010000047" Set adoCon = CreateObject("Adodb.Connection") adoCon.Open DSN Set adoRS = CreateObject("Adodb.Recordset") adoSQL = "SELECT AR_Customer.ARDivisionNo, AR_Customer.CustomerNo, AR_Customer.CustomerName FROM AR_Customer AR_Customer WHERE (AR_Customer.CustomerNo='0000047')" adoRs.Open adoSQL, adoCon myfound = 0 With adoRs If .RecordCount Then While Not .EOF For i = 0 To .Fields.Count - 1 Select Case i Case 0 div = .Fields(i).Value Case 1 cust = .Fields(i).Value Case 2 name = .Fields(i).Value myfound = 1 End Select Next .MoveNext WEnd End If End With If myfound = 1 Then MsgBox "Found " & div & "-" & cust & " " & name Else MsgBox "Not Found " & Mas_Cust End If adoRs.Close adoCon.Close Set adoRS = Nothing Set adoCon = Nothing ;AutoIT ado testing Global $Mas_Cust = '010000047' Validate_Cust() Func Validate_Cust() ; ODBC System DSN definition $DSN = "DSN=Charm"; database as defined in ODBC $adoCon = ObjCreate("ADODB.Connection") $adoCon.Open($DSN) $adoRs = ObjCreate("ADODB.Recordset") ; Create a Record Set - SELECT SQL ; create the SQL statement $adoSQL = "SELECT AR_Customer.ARDivisionNo, AR_Customer.CustomerNo, AR_Customer.CustomerName FROM AR_Customer AR_Customer WHERE (AR_Customer.CustomerNo='" & StringMid($Mas_Cust, 3) & "')" ;MsgBox(0, '', $adoSQL) $adoRs.CursorType = 0 $adoRs.LockType = 1 ; execute the SQL $adoRs.Open($adoSQL, $adoCon) $found = 0 With $adoRs $dimension = .Fields.Count If .RecordCount Then While Not .EOF For $i = 0 To .Fields.Count - 1 Switch $i Case 0 $div = .Fields($i).Value Case 1 $cust = .Fields($i).Value Case 2 $name = .Fields($i).Value $found = 1 EndSwitch Next .MoveNext WEnd EndIf EndWith If $found = 1 Then MsgBox(0, 'Debug', "Found " & $div & '-' & $cust & ' ' & $name) Else MsgBox(0, 'Debug', "Not Found " & $Mas_Cust) EndIf $adoRs.Close ; close record set $adoCon.Close ; close connection EndFunc ;==>Validate_Cust -
I have written an Autoit script that validates the data against a DSN prior to data entry. The validation part works fine, but I began to notice that the RAM on the server was not being released and eventually caused the server to require a reboot. Below is the function that I have been using Func Validate($adoSQL) ; ODBC System DSN definition $DSN = "DSN=Charm"; database as defined in ODBC $adoCon = ObjCreate("ADODB.Connection") $adoCon.Open($DSN) $adoRs = ObjCreate("ADODB.Recordset") ; Create a Record Set - SELECT SQL $adoRs.CursorType = 0 ; Forward Pass thru recordset only $adoRs.LockType = 1 ; Read Only ; execute the SQL $adoRs.Open($adoSQL, $adoCon) $found = 0 With $adoRs $dimension = .Fields.Count If .RecordCount Then While Not .EOF For $i = 0 To .Fields.Count - 1 Switch $i Case 0 $div = .Fields($i).Value Case 1 $cust = .Fields($i).Value Case 2 $name = .Fields($i).Value $found = 1 EndSwitch Next .MoveNext WEnd EndIf EndWith $adoRs.Close ; close record set $adoCon.Close ; close connection Return $found EndFunc ;==>ValidateSeveral other functions build SQL statements and call this function for various data validation and it works well in that regard. Researching this issue, I could not help but notice the similarities in this syntax and that of VBS with one exception. Standard procedure in VBS would be to set the database object variables to Nothing after the 'close' statements. For example ... Set adoRS = Nothing Set adoCon = Nothing The purpose of these statements in VBS, as I understand it, is to release the resources that are in use which would free up memory. My question is what is the correct method for releasing these resources in AutoIT scripting? Thanks, Randy
-
'Enter' & 'Tab' functioning differently
randym replied to randym's topic in AutoIt GUI Help and Support
Thanks jguinch - it is a clever work around... I saw in the documentation I was reading about doing something like this, but you turning my gui into a working example really brought it home. -
randym reacted to a post in a topic: 'Enter' & 'Tab' functioning differently
-
I used Koda to design a form, I set it up so that all but the first field is disabled. I click in the first field to get focus, and enter data. No problem. If I then hit 'Enter' - my code runs that enables the other fields and sets defaults and the like. However, if I hit 'Tab' instead, then all that happens is the data in the field is high-lited and the code associated with the field is never run. Is this as it should be, or have I done something wrong.Weird thing is, once the other fields are enabled, it looks like 'Tab' works, but 'Enter' does not .... - I am confused. Randy #include <Array.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Global $arr = [] ; NOTE this creates an array of size 1 with an empty string Global $Start, $End #Region ### START Koda GUI section ### Global $CharmROG_Form = GUICreate("Charm City ROG Automation", 566, 302, -1, -1) Global $Label1 = GUICtrlCreateLabel("Receipt No", 8, 16, 58, 17) Global $Label2 = GUICtrlCreateLabel("PO No", 208, 16, 36, 17) Global $Label3 = GUICtrlCreateLabel("Inv No", 384, 16, 36, 17) Global $ML_ReceiptNo = GUICtrlCreateInput("Receipt Number", 72, 16, 121, 21) Global $ML_PONo = GUICtrlCreateInput("Purchase Order", 256, 16, 121, 21) GUICtrlSetState(-1, $GUI_DISABLE) Global $ML_InvNo = GUICtrlCreateInput("Invoice Number", 424, 16, 121, 21) GUICtrlSetState(-1, $GUI_DISABLE) Global $Label4 = GUICtrlCreateLabel("Start Line", 8, 48, 49, 17) Global $Label5 = GUICtrlCreateLabel("End Line", 200, 48, 46, 17) Global $ML_StartLine = GUICtrlCreateInput("Starting Detail Dist Line", 72, 48, 121, 21) GUICtrlSetState(-1, $GUI_DISABLE) Global $ML_EndLine = GUICtrlCreateInput("Ending Detail Dist Line", 256, 48, 121, 21) GUICtrlSetState(-1, $GUI_DISABLE) Global $Checkbox1 = GUICtrlCreateCheckbox("Existing ROG", 384, 48, 161, 25, BitOR($GUI_SS_DEFAULT_CHECKBOX, $BS_RIGHTBUTTON)) GUICtrlSetState(-1, $GUI_DISABLE) Global $Input1 = GUICtrlCreateInput("Lot Date", 72, 80, 121, 21) GUICtrlSetState(-1, $GUI_DISABLE) Global $List1 = GUICtrlCreateList("", 201, 80, 183, 175) GUICtrlSetData(-1, "Lot Dates") GUICtrlSetState(-1, $GUI_DISABLE) Global $Label6 = GUICtrlCreateLabel("Lot Date", 12, 80, 49, 17) Global $Button1 = GUICtrlCreateButton("Process", 456, 264, 89, 25) GUICtrlSetState(-1, $GUI_DISABLE) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $ML_ReceiptNo GUICtrlSetData($ML_PONo, GUICtrlRead($ML_ReceiptNo)) GUICtrlSetData($ML_InvNo, GUICtrlRead($ML_ReceiptNo)) EnableForm() GUICtrlSetState($ML_EndLine, $GUI_FOCUS) GUISetState(@SW_SHOW) Case $ML_StartLine Validate_StartEnd () Case $ML_EndLine Validate_StartEnd() EndSwitch WEnd Func EnableForm() GUICtrlSetState($ML_PONo, $GUI_ENABLE) GUICtrlSetState($ML_InvNo, $GUI_ENABLE) GUICtrlSetData($ML_StartLine, 1) GUICtrlSetState($ML_StartLine, $GUI_ENABLE) GUICtrlSetData($ML_EndLine, 1) GUICtrlSetState($ML_EndLine, $GUI_ENABLE) GUICtrlSetState($Checkbox1, $GUI_ENABLE) GUICtrlSetState($Input1, $GUI_ENABLE) ;GUICtrlSetState($List1, $GUI_ENABLE) GUICtrlSetState($Button1, $GUI_ENABLE) GUISetState(@SW_SHOW) EndFunc ;==>EnableForm Func Validate_StartEnd() Get_StartEnd() If $End < $Start Then GUICtrlSetData($ML_EndLine, $Start) GUISetState(@SW_SHOW) EndIf EndFunc ;==>Validate_StartEnd Func Get_StartEnd() $Start = GUICtrlRead($ML_StartLine) $End = GUICtrlRead($ML_EndLine) EndFunc ;==>Get_StartEnd