On 24/06/2020 13:32, Richard Torrens (lists) wrote:
> I am writing a custom function and have found ta repeat until loop that
> causes PipeDream to crash irrevocably.
>
> The function will eventualy write out an HTML table. Something I have done
> before (e.g.
http://stronged.torrens.org/man/PD - though they are PDream
> files which will need filetyping). I'm baffled as to why this one crashes!
>
> zip file attached
>
> This with 4.57.01 (21-Mar-2020) on ARMX6 running 5.27 (09-Jun-20)
>
Thanks Richard
The crash is down to PipeDream not expecting an array as a parameter to
UNTIL().
You are getting this as you have only typed the guarding IF(counter<>0)
and ENDIF in your custom function as text not expressions, so the first
pass through the loop with counter=0 will cause the INDEX(array, 1,
counter) function to return an array containing all the values in column
1 of the array, as you see in B7. The UNTIL() then gets an array of each
value compared against "END" i.e. {FALSE, FALSE ... TRUE}. And then dies
horribly.
Fireworkz does handle this gracefully; I'll add it to the PipeDream bug
list.
Stuart's top tip: when doing array processing it's best to use loops
starting at one!
Cheers, Stuart
--
Stuart Swales