So you mean to say that you will just use A_LastError instead of ErrorLevel in v2?
One of the biggest issues of v1 was ErrorLevel and the impossibility to properly debug it.
v2 fixes this by throwing an Error whenever an Error occurs - to keep it stupid simple.
This also means that if you use any kind of method on a "" or a 0 it will throw an exception.
Then the user has to wonder where that value came from.
To keep it stupid simple we just throw whenever an error occurs.
In any case:
Code: Select all
try comm:= FileOpen('\\.\COM1', 'w')
Why would you do this. What kind of benefit does that give you?
I just don't see any of your arguments actually applying to reality.
You just mention keywords that actually do not defend your point.
Instead of a single line.
What if Programmer or User see: The system cannot find the file specified. (exception if no any serial interface present)
Will Programmer or User can add that serial interface? Probably NO.
Will Programmer or User can activate not shared resource? Probably NO.
What useful information is this?
It is far better than getting the error:
This value of type "Integer" has no method named "..."
Informing the user of what is going wrong with your script and pointing towards solutions that way is a very good practice.
Imagine if the user has a COM interface connected via USB?
What if they just forgot to plug it in. Without any kind of error message the user will probably search for a long time before actually detecting that error.
With the error message that the COM interface is missing they will probably check that first.
Do I really have to explain to you how important user feedback is?