ID:104357
 
BYOND Version:479
Operating System:Windows 7 Home Premium 64-bit
Web Browser:Chrome 7.0.517.44
Applies to:Dream Maker
Status: Deferred

This issue may be low priority or very difficult to fix, and has been put on the back burner for the time being.
Descriptive Problem Summary:
The error(s) thrown from using named arguments on built-in procs that do not support them differ based on the position of the expected argument. Was the named argument supposed to be the first, there are two errors thrown ('arglist() or named arguments cannot be used here' and 'missing expression'). If the named argument is not supposed to be the first, the error becomes ''expected 2 to 3 arguments (found 1)'.

Code Snippet (if applicable) to Reproduce Problem:
mob
verb
Test()
var/h = "test"
h = copytext(h, Start=1) // throws 'expected 2 to 3 arguments (found 1)'
h = copytext(h, 1, End=0) // see abouve
h = copytext(Start=1, h) // see abouve
h = roll(ndice=1, 3) // throws both 'arglist() or named arguments cannot be used here' and 'missing expression'
h = roll(3, ndice=1) // throws the same two errors
src << "[h]"


Expected Results:
Regardless of the expected position of the argument, named arguments in built-in procs that do not support them should throw one error, namely 'arglist() or named arguments cannot be used here', which should contain a link to the reference page on named arguments.

Actual Results:
Depending on the position of the argument, different errors and a different amount of errors is being thrown.

Does the problem occur:
Every time
In other user accounts - Verified on the Developers forum
On other computers - Verified on the Developers forum

When does the problem NOT occur? Never

Workarounds:
Non

This is a very difficult issue to address, but fortunately also very minor. The fact that named arguments aren't supported in almost all built-in procs is documented, so users running across this problem will have to use their best judgment to figure out why.
Lummox JR wrote:
(...) users running across this problem will have to use their best judgment to figure out why.

While I certainly agree that the problem is indeed documented (and minor), I see problems with the average 'developer' using an authoring tool that should carter for easy creation of semi powerful games having knowledge on named arguments. Given the amount of postings concerning puzzled developers 'copy and pasting' the function interface from the reference (especially winshow), I hope you won't mind if I leave a little note on the respective reference entry, explaining the issue to the best of my knowledge and providing an example.
I would definitely encourage leaving notes for those situations.