Why can't I use the “Any” as a name in VBA?

后端 未结 2 1994
情歌与酒
情歌与酒 2021-01-13 01:28

While trying to define an Any() function like python\'s, I found that I couldn\'t name anything \"Any\".

Attempting to name a Function, Sub, Const

2条回答
  •  甜味超标
    2021-01-13 01:42

    To get an updated information to this question and comments, Microsoft states on their own page at https://docs.microsoft.com/en-us/dotnet/visual-basic/language-reference/error-messages/as-any-is-not-supported-in-declare-statements:

    The Any data type was used with Declare statements in Visual Basic 6.0 and earlier versions to permit the use of arguments that could contain any type of data. Visual Basic supports overloading, however, and so makes the Any data type obsolete.

提交回复
热议问题