Jump to content

do until for next while?!?


Recommended Posts

The problem is that all of the For In Next, Do Until, While WEnd, seem to be for trying the same thing over and increasing a variable each time until it reaches a set limit.

Is there a more elegant way to do this than a bunch of if elseif thens?

The actions I need to try in the correct order should only be performed once each and once the condition is met the rest of the actions MUST NOT be performed. I hope this makes sense.

$clipstart = ClipGet()

if ClipGet() = blah or blah1 or $clipstart then

first set of actions

elseif ClipGet() = blah or blah1 or $clipstart then

second set of actions

elseif ClipGet() = blah or blah1 or $clipstart then

third actions

EndIf

Thanks

Edited by anystupidassname

This signature is computer generated, nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#.......

Link to comment
Share on other sites

are you reading from the clipboard.?

Yes, but ignore that. I'm trying to do something until the clipboard contains a certain thing.

Here is a second part to the question too.

What if I have to try pressing down arrow once and then enter and if that doesn't work, press down twice and enter ad nauseum?

This signature is computer generated, nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#.......

Link to comment
Share on other sites

The problem is that all of the For In Next, Do Until, While WEnd, seem to be for trying the same thing over and increasing a variable each time until it reaches a set limit.

Is there a more elegant way to do this than a bunch of if elseif thens?

The actions I need to try in the correct order should only be performed once each and once the condition is met the rest of the actions MUST NOT be performed. I hope this makes sense.

$clipstart = ClipGet()

if ClipGet() = blah or blah1 or $clipstart then

first set of actions

elseif ClipGet() = blah or blah1 or $clipstart then

second set of actions

elseif ClipGet() = blah or blah1 or $clipstart then

third actions

EndIf

Thanks

Switch/ EndSwitch or Select/EndSelect would be better perhaps.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Switch/ EndSwitch or Select/EndSelect would be better perhaps.

Thanks, Select / EndSelect looks good.

This signature is computer generated, nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#.......

Link to comment
Share on other sites

#include<array.au3>
$clip=ClipGet()
$array=StringSplit($clip,@lf)

for $ct=1 to $array[0]
    if $array[$ct] = "whatever you want to search for" Then
        MsgBox(0,"","Found it! "&$array[$ct],0)
    
    EndIf
Next

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...