Jump to content

AutoitMike

Active Members
  • Posts

    194
  • Joined

  • Last visited

Everything posted by AutoitMike

  1. Is there a way that a user can select provided values in a combo box but not be able to manually type anything into the box?? EG: There will be numbers from 1 to 4 where numbers outside of that range is not valid. Thanks in advance
  2. It works great! Thanks very -very-very much
  3. Thanks very much. I will try this later tonight.
  4. I am working with an XML file that has parents with multiple children with the exact same name. Each child is selected by the following: SelectSingleNode “/Parent/abc [n]” Where n is the child number. SelectSingleNode “/Parent/abc [0]” would select the first occurance of “/Parent/abc” I just need to know how many of these child nodes, “abc” exist. I dont need this number to simply get to the last node, i dont even need the value there, I just need to know how many of the child nodes exist. There will sometimes be other child nodes with different names under the same parent. Thanks in advance.
  5. NINE, The word TRUE has to be in quotes!! $oNewNode = $oNodeChild.cloneNode('True') OYE!
  6. I have attached the test file I am using. I thought that just a snippet of the file would work. Maybe thats the problem. Curious to see if you have the same issue. Thanks CloneRPT.hr4
  7. Nine, The child node /genInfo got copied and added to //template, but none of its child nodes or its sibilings got copied / cloned. I thought that the "True" statement was supposed to do this.
  8. I am attempting to copy a child node and all its children below a parent node and append the copy to the same parent. The method to select either of the two child node would then be "SelectSingleNode//Parent/Child [0]" for the first child [1] for the second child. I know that node last and node fist would work here but I plan to create many child nodes once I learn this step. Example I am attempting to change this: <template version="5"> <genInfo> <GA> <GASM> <GASMT>Text</GASMT> </GASM> <GASM/> </GA> </genInfo> </template> Into this: <template version="5"> <genInfo> <GA> <GASM> <GASMT>Text</GASMT> </GASM> <GASM/> </GA> </genInfo> <genInfo> <GA> <GASM> <GASMT>Text</GASMT> </GASM> <GASM/> </GA> </genInfo> </template> The following code produces no error but does nothing: Local $oXML = ObjCreate("Microsoft.XMLDOM") ;For all XML fie operations $oXML.load("C:\Utilities\Temp\CloneRPT.hr4") $oNodeChild = $oXML.SelectSingleNode('//template/genInfo') $oNodeParemt = $oXML.SelectSingleNode('//template') $oNodeParemt.appendchild($oNodeChild) $oXML.Save("C:\Utilities\Temp\CloneRPT.hr4") Thanks
  9. junkew, Then the node specification "prop[@name='element name'] " is how to reference a node that has an attribute/s. whereas "//Root/node name" is how you reference a node that has no attributes???
  10. Thanks for the link. The documentation is quite overwhelming. Why would an application use this screwy method of defining node names? //ABC/MyNode works pretty well. Is there a specific advantage for “prop name”=“Abc” type=“0” ??
  11. Where is the documentation for these XML functions? Thanks
  12. I made a change to protect actual data and goofed. Your example works, You rock. Thanks ever so much,
  13. Nine, I am attempting to add the last two nodes in this sample file. Thanks reportxx.hr5
  14. Nine, Can I send you a sample file?
  15. Nine, I have tried your first line in a few different ways, still fails with the line that appends the new node.
  16. Nine, I get an error "The requested action with this object has failed." on the line that attempts to appendChild(New) I changed the first line to: Local $oNode = $oXML.SelectSingleNode("//ClientList") This is the parent node Thanks
  17. Thanks Nine, I may have miss led you on one item. The parent node is plain, EG: "//ClientList" Then, I need to add the child "Prop name='xxx' type="0" Thanks again
  18. I am trying to create and append a node that reads like the following: prop name="xxx" type="0" This is what it looks like when using XML viewer. When using notepad (to just view it) it looks like this: <prop name="xxx" type="0">xxx value</prop> For nodes with ordinary names, I have no problem adding nodes, EG: $oOther = $oXML.SelectSingleNode('//xCity') $Node=$oXML.CreateElement('ABC') $oOther.AppendChild($Node) The above works fine. In another program I have no problem reading , selecting and setting these types of nodes, EG: $oOther = $oXML.SelectSingleNode("//xInfo/prop[@name='zzz']") MsgBox(0,"",$oOther.text) $oOther.text="123" Thanks for any help
  19. I am not sure what the process name is. I am using the following code to open the file in question: Local $oXML = ObjCreate("Microsoft.XMLDOM") $oXML.load($ReportFile) ;just some of the code here: ;add node year built and update it $oOther = $oXML.SelectSingleNode('//template/genInfo/GA/SM[1]') $Node=$oXML.CreateElement('SMT') $oOther.AppendChild($Node) $oOther = $oXML.SelectSingleNode('//template/genInfo/GA/SM[1]/SMT') $oOther.text=$YearBuilt $oxml.save($ReportFile) ;Now, I got to run an exe that starts up and opens this file. But what is the name of the process that would have $ReportFile open?
  20. My installation does not have WinAPIFiles.au3, but I do have WinAPI.au3 I dont have WinAIObj.au3 My version has the extensive MS Word interface and functionality for which I am fully taking advantage of.
  21. I dont know what IPC signal is. My process only runs one time.
  22. A process of mine opens a HML file, modifies it and then saves, closes it. I then need to run an.exe that opens this file right after this.. However, nothing that I find on this forum works that supposedly tests to see if the fie is still open, ready to be used by another process. Right now, I just Sleep(2000) . I would like something cleaner than this. This function, for example, returns False when nothing has it opened or if I open the file with notepad or any other editor. I am running on a win7 laptop, if that has any bearing. $File="C:\Utilities\test\report.hr5" MsgBox(0,"", _FileInUse($File)) Exit Func _FileInUse($sFilePath) ; By Nessie. Modified by guinness. Local Const $hFileOpen = _WinAPI_CreateFile($sFilePath, $CREATE_ALWAYS, $FILE_SHARE_WRITE) If $hFileOpen Then _WinAPI_CloseHandle($hFileOpen) Return False EndIf Local $fReturn = False If _WinAPI_GetLastError() = 32 Then $fReturn = True Return $fReturn EndFunc
  23. Thanks everyone for the help. I figured that a local array needs to be created and used rather than using the function _FileListToArray
×
×
  • Create New...