Necrotarch Posted October 25, 2012 Posted October 25, 2012 Hey there, I'm currently writing on a small function library for some automatic testing tools. I noticed that there will be a lot of repeated commands in those testing tools. For example send("{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}") You can see how crappy that style is. I allready managed to shorten this special case to: Func _tabrepeat ($repetitions) For $counter = 0 To $repetitions Step +1 Send("{TAB}") Next EndFunc A call for that shortens the example to: _tabrepeat(11) Now i don't want to writea _XXXrepeat($repetitions) for every command i might Need. The idea would be about this _dotimes($command, $repetitions) to load the command i Need repeated into the function and reproduce it $repetition times. So the example called would look about like this: _dotimes(Send("{TAB}"), 11) Now i have to load the command "Send("{TAB}")" or any other command from the variable in a way i can actually use it. Is that possible somehow?
JohnOne Posted October 25, 2012 Posted October 25, 2012 Send("{TAB 11}") from help file. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
PlayHD Posted October 25, 2012 Posted October 25, 2012 (edited) or Run("notepad.exe") WinWaitActive("Untitled") $ToDo = 'Send("{TAB}")' _DoTimes($ToDo,11) Func _DoTimes($dString,$dRepead) For $i = 1 To $dRepead Execute($dString) Next EndFunc Edited October 25, 2012 by PlayHD My UDF : _WinShake, _WinSplitMy Apps : Google Guitar Bot, PuzzleGameDesign Gui : Interesting Tabs Design, RBox Project (abandoned), Animated Gui on Exit
water Posted October 25, 2012 Posted October 25, 2012 Which automation tool are you talking about? There are some threads on the forum talking about software automation tools. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Necrotarch Posted October 25, 2012 Author Posted October 25, 2012 First of all: sorry for noobing around like this. @Wayfarer Thanks that was just what I ment! @ AutoIt MVPs (MVP) Well the tools dont even exist yet to be honest ^^'' in the end ist supposed to perform various checks on a certain programm that is under constant further decelopment. Regardless of that the in the end tool's suposed to run over night, check if everything is still working properly after changes in in the code, check for 0,00€ prices on articles in the integrated catalogue and basicly write an error protocoll to a .txt file
water Posted October 25, 2012 Posted October 25, 2012 Hi Necrotarch, our names are PlayHD and Water, Wayfarer and AutoIt MVPs (MVP) are our titles As you are about to write a library I would stick with JohnOne's proposal. IIRC I have seen such an automation library on the forum - but can't remember where. Will have a look. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
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