Jump to content
Sign in to follow this  
Necrotarch

Feeling Stupid, need help!

Recommended Posts

Necrotarch

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?

Share this post


Link to post
Share on other sites
PlayHD

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 by PlayHD

Share this post


Link to post
Share on other sites
water

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 (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
Necrotarch

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

Share this post


Link to post
Share on other sites
water

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 (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×