Pan6 vs PanX Undocumented Text Funnel Difference

I bet this is something most users don’t know.

Paste the following code into Pan 6 and PanX.

 Local t1
 t1 = "Now is the time for good men"
 t1 = t1[SEARCH(t1, "XYZ"),-1]
 message t1
RTN

In Pan6, since the search results in a 0 (zero), Pan6 ignores the code line. But in PanX, the line is executed, and results in a blank.

The PanX behavior is more logical and consistent, and is better behavior. But the Pan6 behavior allowed an old macro of mine to continue to work, even though circumstances changed from when I first wrote the macro.

Most likely, very few, if anyone, will run into a problem with this. But it caused me no end of trouble to track down why my Pan6 macro was failing in PanX, when there were no syntax issues with code.

Single-stepping, if only, if only… [broken record playing]

Vic

This is what I get when I run your code in Pan 6

The difference seems to be that in Pan 6 "XXX"[0,-1] is XXX, while it is a blank in Pan X.

The behavior of a text funnel with an index of zero is not documented. In creating Panorama X I attempted to make it compatible with the documented behavior of Panorama 6. But for undocumented behavior, that’s not necessarily going to be the same. Remember, Panorama X is entirely new code.

If this had been reported a few years ago I would probably change it. At this point, however, Panorama X has had this undocumented behavior for 7 years. Changing it could possibly break existing Panorama X code, though of course in either version no one should be counting an undocumented behavior.

This is not the case. I think you are imagining that if you could single step you would see it jump over the line, but you wouldn’t. Panorama 6 isn’t ignoring the line with the text funnel, but the text funnel is handling the zero value in a different way. Really zero should probably cause an error, because it is not a legitimate value.