The JADE 2022 release meets tomorrow’s business demands.
Many languages now have string interpolation so that instead of
"Name: " & name & " Age: " & age
you can do something like
"Name: {name} Age: {age}"
which is faster to type and more readable.
It would also be nice when interpolating to automatically convert any non-string values to string by doing the default .String cast so that if age was an Integer we could do
"Age: {age}"
instead of
"Age: {age.String}"
In the interim, in case it's useful I've utilised the ParamListType in the past to create my own primitive method to do the text substitution as per the following example. Feel free to create something similar yourself:
Here's a couple of examples of using the method. The first example displays 'Something with Bob and Dan in the text' to the interpreter output window. The second example results in a developer exception being raised, and no additional details in the interpreter output window:
It would be good if it supported 'calling methods' which return values as well as local variables/parameters/properties.
For example: "Name : {person.getStandardNameDisplay()} Age: {person.getAge()}"
It would also be good if auto-complete could still make suggestions inside the {} even though you're defining a 'string literal'.