Hi Gryff,
If you want code to look right here in the forum, use the code tags, not quote tags.
I took your code and added another nesting by another IF, and here's how TEXT..ENDTEXT indentation by beautiy has to work:
Code:
If llTekTipscodesample
lcSAMPLE = "SAMPLE"
TEXT TO sqlHandle TEXTMERGE NOSHOW
SELECT count(acct) AS xcount FROM SAMPLE.DBO.SAMPLE
ENDTEXT
If SQLExec(connhandle, sqlHandle, 'sample') < 0
Aerror(laErrors)
Messagebox(laErrors[2],16,"Error in SQL exec for sample")
Endif
Endif
You see the lines with TEXT and ENDTEXT do get indented, but the SELECT-SQL query sticks to the left. That's because indentation here would not only indent the code, it would change the textmerge result. In case of an SQL you execute that would not matter, but in cases of other things like mail merge text you'd cause indentation where it is not wanted.
Because TEXT ENDTEXT are the begin an end of a code section that suggests all lines within could be indented but the inner text is never indented (also not in VFP9) - that's normal. Again, because the indentation would influence the result.
VFP8 or 9 introduced a PRETEXT clause of TEXT..ENDTEXT, that make it possible to indent the inner text, as you finally can remove leading space with the right PRETEXT constant but that also does not make indentation automatic in beautify. So you're not missing anything in regard to how this behaves in future versions.
The only good news I can tell you is that once you manually indent this, it will stay that way also with further beautify. And the reason is again the same, changing the indentation would change the result of TEXT..ENDTEXT, so VFP beautify never touches it and always leaves it the way you write it, unindented or indented.
Chriss