User text input

cnzlf's icon

Hello,

I have [udpsend 255.255.255.255 #PORT#] where #PORT# should be defined by user thru text input. I need a text box on my presentation to replace #PORT# number. How can this be done? I've searched everywhere, no joy. Any help is highly appreciated.

Thanks in advance.

Bill 2's icon

Is this what you're after? From the udpsend reference: "The word port, followed by a number, specifies the remote port that the udpsend object will use to send outgoing messages."

cnzlf's icon

Hello Bill,

no, what I meant is that I want the user to input the port number himself in standalone. An empty text box that whatever number the user type will replace the port argument of udpsend.

Bill 2's icon

Oh... I don't know much about standalones or even text in Max, but are there bits in this that you could use?

Max Patch
Copy patch and select New From Clipboard in Max.

cnzlf's icon

Sorry that didn't help. Appreciate your time though.

hoowdie's icon

Hey, why didn't Bills reply help? Thats excactly what you described :) Textbox where you can put in numbers and they become the port of the udp object.

best regards

Bill 2's icon

Yeah, I'm a bit confused, too. Even more than usual. ;-)

pdelges's icon

You don't need a text, ports are numbers. A simple number UI object will do it, and could event protect against bad inputs from the user (like strings or negative numbers).

cnzlf's icon

Bill, I apologize! I have no idea what went wrong on my side, when I pasted your code it didn't work, but now I restarted Max and it worked flawlessly.

Again, appreciate your time and help. Many thanks, you guys are awesome.