Curious about the operation of this script - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8) +--- Thread: Curious about the operation of this script (/showthread.php?tid=2780) |
Curious about the operation of this script - JRP - 07.08.2020 Hello I have this sample script for the definition and call of functions. Code: function max(numero1, numero2) I have this other variation. Code: max = 4, 10 Here the problem is that if I change the order of the numbers, the function does not return the highest, it seems that it always returns the first. What could this be due to? Is the way to call the function and pass it the arguments wrong? a greeting RE: Curious about the operation of this script - admin - 07.08.2020 You don't need to create a function for this, just use math.max instead. It accepts any number of arguments, not just 2. As for your second example, you assign 4 to max variable. 10 is not assigned to any variable. You can assign multiple variables this way but you need to specify them like this: Code: a, b = 4, 10 RE: Curious about the operation of this script - JRP - 08.08.2020 Thanks admin for the answer. The script is only an appearance test for the functions, however thanks for the note from math.max. Indeed, as soon as I read it, I have noticed what you say, thank you very much. a greeting |