Jump to content

AvgGamerGuy

Members
  • Posts

    11
  • Joined

  • Last visited

AvgGamerGuy's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. The following section of code reads two nodes from an XML file. Each node should be an array of up to 14 items. Some of the items may be blank. One node contains monthly payment amounts and the other node contains the dates that the payments are due on. The section of code I'm having trouble with is a function designed to check the data and verify that there is an equal number of payments and dates (i.e. if there are 10 scheduled payment dates in the payment date node, there should be a corrosponding 10 payments in the payment node). The function should compare each unit of the array in the payment node with the payment date node and makes sure that if one is blank or empty that the other one is empty and should assign an error value if one node has something and the other one doesn't. But it's not setting my error flag. Code is below CODE Func _PaymentAndDateError($PaymentNode, $PaymentDueDateNode);-------- Local $NumOfPayments, $NumOfScheduledDates Local $EqualError = 0 $NumOfPayments = _XMLGetValue($PaymentNode) $NumOfScheduledDates = _XMLGetValue($PaymentDueDateNode) If IsArray ($NumOfPayments) And IsArray ($NumOfScheduledDates) Then For $T = 1 to 14 MsgBox(0, "Debug", "$NumOfPayments[" & $T & "] = " & $NumOfPayments[$T] & "$NumOfScheduledDates[" & $T & "] = " & $NumOfScheduledDates[$T]); debug msgbox MsgBox(0, "EqualError", "$EqualError = " & $EqualError); debug msgbox If (($NumOfPayments[$T] = "") And ($NumOfScheduledDates[$T] <> "")) Then ; this is where i'm having the trouble....it should check this and then assign $EqualError to 1 if one has something in it and the other one doesn't....but it's not. $EqualError = 1 Return $EqualError EndIf Next Return $EqualError Else SetError(1,3,0) EndIf EndFunc; _CheckNumofPaymentsAndDates---------------------------------- Any help would be appreciated!
  2. I'm having trouble using StringFormat to force the output of the decimal and two zero's behind the decimal of a variable that is an integer. It's not displaying the decimal and the zero's, only the integer. I'm obviously doing something wrong. Can anyone point out my errors? I'm attaching the relevant piece of code Func _GetTotalDue($PaymentNode);--------------------- Local $PaymentArray = _XMLGetValue($PaymentNode) Local $ret_val = 0 Local $FilteredNumber[15] Local $FilteredNumberWithDecimal[15] If IsArray($PaymentArray) Then For $T = 1 to 14 If $T = 1 Then Sleep(10) EndIf $FilteredNumber[$T] = Number(StringReplace($PaymentArray[$T], ",", "")) $FilteredNumberWithDecimal[$T] = StringFormat("%.2f", $FilteredNumber[$T]); here's where i'm having the problem I think <--------------- $ret_val += $FilteredNumberWithDecimal[$T] Send("Payment # " & $T & " is " & $FilteredNumberWithDecimal[$T] & " Running Total is " & $ret_val & @LF); I need to send the text to Word here Sleep(500) Next Send(@lf) Return $ret_val Else Return SetError(1,3,0) EndIf EndFunc; _GetTotalDue----------------------------------- any help would be greatly appreciated! I'm an idiot.....answered my own question....the variable that was not showing the decimal and zeros was not $FilteredNumberWithDecimal[$T] it was $ret_val which I never used StringFormat on! Sorry!
  3. Hi much smarter than me people! Someone pointed me to the _XMLDomWrapper.au3 to read XML files. I have figured out how to load the file using _XMLFileOpen but am stuck trying to parse the file to read individual data for each branch in the XML file. Here's my short section of code...it doesn't do much but open the file and then try to read one piece of data at this point. I'm also attaching the XML file that I'm trying to read. The XML file is created from an Adobe Acrobat 7.0 professional document. The value that I'm trying to load is the clients name that is a text field on the Adobe form. I'm getting the XML data file loaded ok (according to my debug msg box) but when I try to use "_XMLGetValue" to read the client name I'm getting a "-1" value and it's failing according to my debug msg box. I'm messing something up. Can anyone help? #include <_XMLDomWrapper.au3> Global $ClientName, $FileOpen $FileOpen = _XMLFileOpen("C:\Program Files\AutoIt3\Todd's scripts\Contract Creator\testSOS_data.xml") if $FileOpen Then MsgBox(0, "Open File Correctly?", "Yes") elseIf $FileOpen = -1 Then MsgBox(48, "Open File Correctly?", "NO") EndIf $ClientName = _XMLGetValue("form1/Name") if $ClientName = -1 Then MsgBox(48, "Error", "Could Not Load Client Name") else MsgBox(0, "Client Name is", $ClientName) EndIf ---------------------------------------------------- Thanks! testSOS_data.xml
  4. Great, thanks AdmiralAlkex.....I'm looking at the XML DOM wrapper now.
  5. Will autoit be able to open an XML file with the FileOpen function? If so...anyone have any pointers on how one would go about reading on parsing and reading and XML file? Thanks!
  6. When you say "zombie IE processes" are you referring to the processes listed in the windows task manager? If you are, I don't see any more than one instance of explorer running. If i run the script with one instance of "iexplore.exe" listed in the task manger prior to running the script it works just fine. If i run the script with no instances of "iexplore.exe" listed in the task manager, it appears to freeze up when it loads Iexplore.exe
  7. I'm using Windows XP Professional, Service Pack 2 I'm using Internet Explorer 7.0.5730.13
  8. Hi gang, I have a simple script (it's really just so that I can play with and learn the functionality of the IE.au3 stuff) The script works just as I would expect if I already have an Internet Explorer window open.... The script opens up a new Explorer window and inputs the URL "https://www.google.com" and it loads right up. The problem is when I don't have an existing Explorer window open BEFORE I run the script, the script seems to call Internet Explorer and try to open it but then it locks up or hangs and will never go to URL as it does when another Explorer window is already open. It freezes there and the only thing I can do to close the non-responding Explorer window is to CTR+ALT+DEL to bring up the task manager and kill it. Any ideas? Thanks! test.au3
  9. Thanks Guys, I found in the help file where it does show any #includes that must be included for any specific functions. Thanks to Mike, I also found the folder in the autoit directory labeled "include" that has all of the include files and am able to easily open them up in the sciTe editor to view them. You guys are the bomb!
  10. I'm just trying to learn autoit and have some experience with C++ I'm familiar with the need to include some files using the #include depending on the code that would be used in a script. My question is where can I find a list of all of the available #include files with a list of all of the commands that require #include files to be included. I've searched the autoit online documentation page at: http://www.autoitscript.com/autoit3/docs/ And can't seem to find any information on this question there. Can anyone point me to a resource? Thanks!
×
×
  • Create New...