I have written a couple of aliases that reference functions and they work great, but I'm trying to write one that has to pass an alias parameter as an argument to the function and I can't figure out the correct syntax. The function I'm trying to call is:
_command _str capitalize (_str string = "") {
return upcase(substr(string,0,1)) :+ substr(string,1);
}
I defined a couple of alias parameters attr = "size" & type = "String"
And the the alias:
public void set%\m capitalize %(attr) % (%(type) %(attr)) {
this.%(attr) = %(attr);
}
which seems to follow the syntax outlined in the help file, it throws a Slick-C error with a Stack trace that says there's an invalid argument. If I modify it slightly, using parens, which seems to look right I tried:
public void set%\m capitalize(%(attr))% (%(type) %(attr)) {
this.%(attr) = %(attr);
}
There's no error, but the output isn't what was expected.
/**
* Set the value of the size attribute.
*
* @param size The new size value as a String
*/
public void set(attr))(type) size) {
this.size = size;
}
(*Chris*)