Pass TextBox as Parameter

Get help using Construct 2

Post » Fri Jan 03, 2014 1:03 pm

Hi all,

Im new here and sorry for my english.

I have a function with Two Parameters:

WriteMyText (textboxName, sometext)

If I Call it passing the name of a textbox of the proyect and some text:

WriteMyText("txtName", "John")

How can I do something like that inside the function:

textboxName.setText=text (the text of the txtName has the text "John")

Because I dont know who specify that set the text in the function.Param(0)

Thanks!
B
3
Posts: 3
Reputation: 181

Post » Fri Jan 03, 2014 1:13 pm

You probably want textbox.text, which is the text inside the textbox.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri Jan 03, 2014 1:15 pm

You cannot do this in that way.

Instead, you can pass the ID of the textbox and then select it in the function... that is

LocalVariable = txtBox.UID

WriteMyText(LocalVariable, "John")

and in WriteMyText you can use the Pick by unique UID
I'm not a insane, my mother had me tested

I'm an engineer. To save time, just assume I'm never wrong
B
31
S
13
G
4
Posts: 141
Reputation: 4,857


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests