Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Difference between ERROR and ERROR$ functions 1

Status
Not open for further replies.

vassoft

Programmer
Jun 12, 2002
18
MY
hello
I am having doubt.
What is the difference between Error() and Error$()
functions.

Both are error functions returning same values.

I need to know What is the significance of "$".

I am very thankful in this regard

Vasu
 

Same same. The "$" indicates that the function returns a string. Error always returns string. This is not the case for other functions e.g. Mid returns a variant whereas Mid$ returns a string.

Sunaj
'The gap between theory and practice is not as wide in theory as it is in practice'
 
Error simulates the occurrence of an error, and returns the description error (as a Variant) that occured and is only supported for backward compatibility.

Debug.Print Error(13)
Will just print the error description of error number 13.

Debug.Print Error
Will do nothing

Error(13)
Will raise an error

Error$ only returns the description of a error number as a string and corresponds to the Description property of the Err object.

Debug.Print Error$(13)
Will just print the error description of error number 13.

It is also obsolete.

Use the Err object instead. *******************************************************
General remarks:
If this post contains any suggestions for the use or distribution of code, components or files of any sort, it is still your responsibility to assure that you have the proper license and distribution rights to do so!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top