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 , 18 years ago
| Version: | 3.2.10.0 |
|---|
comment:2 by , 18 years ago
| Resolution: | → Rejected |
|---|---|
| Status: | new → closed |
This actually sounds worse than Goto... not happening.
comment:3 by , 18 years ago
| Resolution: | Rejected |
|---|---|
| Status: | closed → reopened |
So, do YOU have a solution?
Or do you think the "Add 700 identical statements" is the best way ?
comment:4 by , 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 , 18 years ago
| Resolution: | → Rejected |
|---|---|
| Status: | reopened → 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.

Automatic ticket cleanup.