bad arguments for message "int"
I'm trying to update a numbox via JS. When I run the code, it returns an error "bad arguments for message "int" ."
What am I doing wrong here ?
var p = this.patcher;
var MODE = 0
var PROGRAM = 1;
function Preset(t) {
PROGRAM = t;
if (!MODE) { // if MODE is 0'
p.getnamed('#1PerfNum').message('int', PROGRAM); // #1PerfNum is the script name of a numbox
} else { // if MODE is 1
p.getnamed('#1PresetNum').message('int', PROGRAM); // #1PresetNum is the script name of a numbox
}
};
Hi
you need to be sure that your "t" argument is not a "float" or "list" where its first element is a "string" (symbol) .
Thanks KrisW.
I attempted to use function Preset(PROGRAM) instead of Preset(t) because the type for the global variable PROGRAM is int, but that didn't work either.
How would I coerce these types to be what's needed for the Max objects ? I'll be researching, but it has historically taken me down rabbit holes trying to find this information.