Re: Is this possible?

new topic     » goto parent     » topic index » view thread      » older message » newer message
SDPringle said...

Is the following line CChris be equivalent to a 3.1 function definition since you'll need to supply a fourth argument or can optional arguments really be in the middle and beginning? Does the function foo(3,4) assign to p and r?

function foo(integer n=0,integer p,integer q=2,integer r) 

The error should be foo requires at least 2 but at most 4 arguments.

Actually, in the example you gave, I think it requires 3 (or 4) arguments, it's just that the first and third can be defaulted with a blank instead of a value: foo(39) (hope I typed that right) the results should be {0,3,2,9}

So the question is really how to word the message to give the most useful info in the least confusing way. Maybe something like "foo requires 4 parameters, (1 and 3 may be defaulted)"

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu