Forums > MaxMSP

Adding machine suggestion

May 18, 2012 | 7:27 pm

Hello patchers!

I need an object that simulate the behavior of a calculator.
Which means that when I type 1 and then 2 i need to get 12 and if i type 3 the final result has to be 123.

I hope this make some sense…

Thanks

T


May 18, 2012 | 8:05 pm

Maybe the numkey object?


May 19, 2012 | 12:26 am

if you dont mind to select it first … a numberbox will do that, or a textfield.


June 7, 2012 | 9:31 pm

Howdy,

Did you ever figure this out? I’ve been trying to do the same thing–have separate messages with corresponding numbers (1,2…9,0) with +,-,/,* functions to display like a calculator–I’ll tie in other things once this part is done, but I’m having a heck of a time making it work. For entering in the number "12" the user needs to be able to click "1" followed by "2" and then the math operator… I thought using a bucket might work or appending, but haven’t gotten it to work yet… Any suggestions?
Thanks!


June 8, 2012 | 9:22 pm

Got it—nice challenge!

Had to look up how to remove spaces in lists, [regexp] and some other methods can be made to work. Here’s a full calculator for you to mess with, click "P" to go to Presentation and hide the mess.

It doesn’t show the numbers as you enter them, it was getting kind of messy, but if you want that, you can use the "append" message to a couple [textedit] objects, with some logic to clear them etc. They would be for display only, so make them Ignore Click.

– Pasted Max Patch, click to expand. –

Viewing 5 posts - 1 through 5 (of 5 total)