jaynabonne wrote:As a side note, did you know about passing scripts to functions, that you can inline the final parameter? For example, if you have a function like:
<function name="myFunc" parameters="list, script">
// do something with the list
invoke(script)
</function>
Then you can call it with:
myFunc(list) {
msg("myFunc has finished!")
}
Oops didn't see that post...
And yes, but I don't think it's necessary for what I am doing.
[wish there was a strikethrough code]However... Could you help with something else?
I can't seem to figure out how to capitalize words after every space for things like names.
I might be missing a built-in function, but I've tried to make a function that includes the "CapFirst" "Replace" and "Split" functions, but they don't work. It spits out an error message saying that those 3 functions don't exist.[/strikethrough]
EDIT: Nevermind, I sort of found a way around it.
<function name="CapSpaces" parameters="text" type="string">
text = Replace (text, " a", " A")
text = Replace (text, " b", " B")
text = Replace (text, " c", " C")
text = Replace (text, " d", " D")
text = Replace (text, " e", " E")
text = Replace (text, " f", " F")
text = Replace (text, " g", " G")
text = Replace (text, " h", " H")
text = Replace (text, " i", " I")
text = Replace (text, " j", " J")
text = Replace (text, " k", " K")
text = Replace (text, " l", " L")
text = Replace (text, " m", " M")
text = Replace (text, " n", " N")
text = Replace (text, " o", " O")
text = Replace (text, " p", " P")
text = Replace (text, " q", " Q")
text = Replace (text, " r", " R")
text = Replace (text, " s", " S")
text = Replace (text, " t", " T")
text = Replace (text, " u", " U")
text = Replace (text, " v", " V")
text = Replace (text, " w", " W")
text = Replace (text, " x", " X")
text = Replace (text, " y", " Y")
text = Replace (text, " z", " Z")
text = CapFirst(text)
return (text)
</function>
and then I use
msg (CapSpaces( string ))
Maybe there's an easier way than doing this though?