ID:1027985
 
(See the best response by Speedro.)
Code:
if(!(length(nameval) > 4))
errors += "Your name must be at least 5 characters in length.\n"
if(!ageval)
errors += "You must enter an age.\n"
if(errors)
winset(src, "errorsLabel", "text=[errors]")


Problem description:

Hey guys, something weird is going on here. I'm trying to update a label with error messages, yet it's acting funny.

If my name is too short, instead of displaying the full text string as shown, all it writes in the control is "Your". I have no idea why this is happening, does anyone have any suggestions?

Best response
You need to use "\" macro to get all the text in.

eg

winset(src,"label","text=\"Hello There\"")
Oh wow, that worked. I understand why thats required now.
Thanks Speedro!
you could also use list2params proc. Just saying
I'm not using any lists in this example though, so how could that help?
winset(src,"whatever.label","text=list2params(list(text123 123))"


that breaks up the text and displays it properly on the label.
Ah, thats helpful if I'm trying to use multiple variables.
Shouldn't that be this instead though;

list(text123, a123)


As far as I know you can't start a variable name with a number. Nor can you have spaces in it.
The proper example to show for how to use list2params in winset():
var params[] = list(
"text" = "blah blah",
"other parameter" = "blah blah"
)
winset(src, label, list2params(params))

It's meant for when you want to modify multiple properties of a control. You can even modify multiple controls, all in a single winset() call.
var params[] = list(
"label.text" = "blah",
"label.thing" = "thing",
"other_label.text" = "etc"
)

// The null allows you to modify multiple controls
// by specifying them in the last argument
winset(src, null, list2params(params))
Wow, I didn't know you could work with parameters like that. Instead of making multiple winset calls, I can just deal with it all in one for my procs, so long as it's okay for them to all be updated at that time.

It also looks a lot cleaner than separating all the assignments with semicolons. Thanks Kaiochao.