Kruxe Posted February 13, 2020 Posted February 13, 2020 Hey Guys! I was hopping I could get some help on this topic, I will try to explain what i am trying to do as clearly as I can! In a nutshell, I am using the API a program and attempting to find all of the "TRACE FIELD" objects within its active page. using the code you see below i can do just that, upon executing the code the For loop will run over and over, going through each trace field and grabbing the text in each one until there are none left. My question is how could I take the text from each instance and save it into either individual variables or one large variable that houses all the data before the look resets and wipes the text from the previous iteration? I hope this made sense, thanks in advanced guys! Kruxe
Developers Jos Posted February 13, 2020 Developers Posted February 13, 2020 Moved to the appropriate forum, as the AutoIt Example Scripts forum very clearly states: Quote Share your cool AutoIt scripts, UDFs and applications with others. Do not post general support questions here, instead use the AutoIt Help and Support forums. Moderation Team SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Nine Posted February 13, 2020 Posted February 13, 2020 (edited) Just put the $Tracefields into a 1D array that you increment at every find. I would have given you an example, but with an image, I did not have the courage of rewriting your script. Next time, please use this tool, when you post code... Edited February 13, 2020 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Kruxe Posted February 13, 2020 Author Posted February 13, 2020 Local $DmisApp = ObjCreate("PCDLRN.Application") Local $DmisActivePartProgram = $DmisApp.ActivePartProgram Local $DmisCommands = $DmisActivePartProgram.Commands Local $CommandCount = $DmisCommands.Count Local $DmisCommand = $DmisCommands.Item($CommandCount) For $DmisCommand In $DmisCommands If $DmisCommand.Type = "191" Then $Tracefield = $DmisCommand.GetText(258,0) MsgBox("","",$Tracefield) EndIf Next @Nine sorry about that, still very new here. Here you go!
Nine Posted February 13, 2020 Posted February 13, 2020 (edited) Try this : #include <Array.au3> Local $DmisApp = ObjCreate("PCDLRN.Application") Local $DmisActivePartProgram = $DmisApp.ActivePartProgram Local $DmisCommands = $DmisActivePartProgram.Commands Local $CommandCount = $DmisCommands.Count Local $DmisCommand = $DmisCommands.Item($CommandCount) Local $aResult[$DmisCommand], $iCount = 0 For $DmisCommand In $DmisCommands If $DmisCommand.Type = "191" Then $Tracefield = $DmisCommand.GetText(258, 0) $aResult[$iCount] = $Tracefield $iCount += 1 EndIf Next Redim $aResult[$iCount] _ArrayDisplay ($aResult) Edited February 13, 2020 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Kruxe Posted February 14, 2020 Author Posted February 14, 2020 @Nine Good Morning, I Tried to run the code you provided but i received this message... ==>Array variable has incorrect number of subscripts or subscript dimension range exceeded.: $aResult[$iCount] = $Tracefield ^ ERROR any idea why that is?
Kruxe Posted February 14, 2020 Author Posted February 14, 2020 @Nine I figured it out, just had to change $aResult[DmisCommand] to $aResult[9] and it popped right up! Thank you so much for the help!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now