Opened 16 years ago

Closed 16 years ago

#202 closed Feature Request (Rejected)

Would like to be able to Branch on condition

Reported by: Everseeker Owned by:
Milestone: Component: AutoIt
Version: Severity:
Keywords: Cc:


Before you whack this request for a GoTo, let me explain...
Consider a stack of a couple hundred records, with 50 elements in each.
In a loop, pull 1 record and perform 70+ transforms on various parts of the record, including feeding data to an external application after each transformation. When done, get the next record and repeat.. all well and good, nothing new here.
Now, consider the following issue: at any point in the processing, the external application can throw up a "Bad data" box. I am catching that event Via Adlib()
So, Error box caught.. and, because this means the Data is bad, I can NOT process this record any more. So how do I abort the record?
There is no way to "On condition, branch to the end of the loop"

The consensus in the forums is that, before each and every single statement in the loop, I have to add an "If $Abortcode="false" then condition.
For 3 or 4 statement loops, that's fine, but for 70+ steps, with an average of 10 lines per step, you're talking about adding 700 lines of code.
That is a bit much....
So, I am proposing as an extension of If...Ehen... Else
If...Then ::Label
and ::Label be added as a location marker
(If you ever see some idiot use If 1=1 then ::Label, feel free to fry them in oil)

Attachments (0)

Change History (5)

comment:1 Changed 16 years ago by TicketCleanup

  • Version deleted

Automatic ticket cleanup.

comment:2 Changed 16 years ago by Valik

  • Resolution set to Rejected
  • Status changed from new to closed

This actually sounds worse than Goto... not happening.

comment:3 Changed 16 years ago by anonymous

  • Resolution Rejected deleted
  • Status changed from closed to reopened

So, do YOU have a solution?
Or do you think the "Add 700 identical statements" is the best way ?

comment:4 Changed 16 years ago by anonymous

Yes. You can have the AdLib() function spawn a new copy of your script and pass as a paramater, the next record number to execute
then terminate the current script


comment:5 Changed 16 years ago by Valik

  • Resolution set to Rejected
  • Status changed from reopened to closed

It doesn't matter if I have a solution or not, that's not what the issue tracker is for. Don't re-open the ticket.

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

as closed The ticket will remain with no owner.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.