Field content as parametres in a function

Tore Nilsen tore.nilsen at me.com
Tue Nov 29 06:25:07 EST 2022



> 29. nov. 2022 kl. 12:08 skrev Alex Tweedly via use-livecode <use-livecode at lists.runrev.com>:
> 
> Yes, your description is correct (except for saying the behavior is "puzzling" :-)
> 
> The first case you are passing a single parameter (which happens to have commas in its current content). You could have said " .... paramcount() returns 1 as expected".
> 
> The second case you pass 5 values.
> 
> And the third case, as you say, expands the value first, so it becomes a call with 5 parameters.
> 
> Alex.

What is «puzzling» to me, among a whole lot of other things I fail to grasp, is why in the first example, the value in field «test» is treated as a single parameter, but in the last example it is treated as five parameters, since nothing has changed with the values in the field itself. I do however accept the reality of it, but I wanted to understand why this is the way it is. My original thinking was that by referencing the field as parameter, the values of the field would then become de facto parameters passed on to the function. I guess it is just another item in the long list of things I do not fully understand. :-) 

Best regards
Tore


More information about the use-livecode mailing list