Thank you for the suggestion. Yes, that does deliver the output I want – but at the expense of mangling the data structure. The reason I called the variables “aa...” was that I have
associate arrays given, and I just needed a way to display them nicely.
But I found a workaround that keeps the data structure intact. It even has the nice side effect that the syntax coloring now doesn't take some of the keywords, such as “top” and “end”, as reserved keywords anymore. (At least in NP++ – this bulletin board' s heuristic is more discriminating.)
Code: Select all
aa1 := {1begin: 100, 2middle: 200, 3end: 300}
aa2 := {05top: 0, 10center: 10, 15bottom: 20}
msgbox % ToString(aa1)
msgbox % ToString(aa2)
ToString(aa, omit_initial_numbers := True) {
r := ""
For key, value in aa {
if omit_initial_numbers
key := RegExReplace(key,"^\d*")
r .= Format("{}:`t{}`n", key, value)
}
return r
}