Modify

Opened 18 years ago

Closed 18 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:

Description

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 by TicketCleanup, 18 years ago

Version: 3.2.10.0

Automatic ticket cleanup.

comment:2 by Valik, 18 years ago

Resolution: Rejected
Status: newclosed

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

comment:3 by anonymous, 18 years ago

Resolution: Rejected
Status: closedreopened

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

comment:4 by anonymous, 18 years ago

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

:P

comment:5 by Valik, 18 years ago

Resolution: Rejected
Status: reopenedclosed

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.

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.