1- Function TestObjectIsAnyTypeOfNumber( ByRef objToTest)
2- 'region FunctionMetadata ####################################################
3- ' Safely determines if the specified object is a number (of any kind). In other words, this
4- ' function checks to see if the specified object is an integer or floating point number
1+ Function TestObjectIsAnyTypeOfNumber( ByVal objToTest)
2+ 'region FunctionMetadata #######################################################
3+ ' Safely determines if the specified object is a number (of any kind). In other
4+ ' words, this function checks to see if the specified object is an integer or
5+ ' floating point number
56 '
6- ' Function takes one positional argument (objToTest), which is the object to be tested to
7- ' determine if it is an integer or floating point number
7+ ' Function takes one positional argument (objToTest), which is the object to be
8+ ' tested to determine if it is an integer or floating point number
89 '
9- ' The function returns boolean True if the specified object is an integer or floating point
10- ' number, boolean False otherwise
10+ ' The function returns boolean True if the specified object is an integer or
11+ ' floating point number, boolean False otherwise
1112 '
1213 ' Example 1:
1314 ' objToTest = "12345"
@@ -34,37 +35,38 @@ Function TestObjectIsAnyTypeOfNumber(ByRef objToTest)
3435 ' boolResult = TestObjectIsAnyTypeOfNumber(objToTest)
3536 ' ' boolResult is equal to False
3637 '
37- ' Version: 1.0.20210724 .0
38- 'endregion FunctionMetadata ####################################################
38+ ' Version: 1.1.20230422 .0
39+ 'endregion FunctionMetadata #######################################################
3940
40- 'region License ####################################################
41- ' Copyright 2021 Frank Lesniak
41+ 'region License ################################################################
42+ ' Copyright 2023 Frank Lesniak
4243 '
43- ' Permission is hereby granted, free of charge, to any person obtaining a copy of this
44- ' software and associated documentation files (the "Software"), to deal in the Software
45- ' without restriction, including without limitation the rights to use, copy, modify, merge,
46- ' publish, distribute, sublicense, and/or sell copies of the Software, and to permit
47- ' persons to whom the Software is furnished to do so, subject to the following conditions:
44+ ' Permission is hereby granted, free of charge, to any person obtaining a copy of
45+ ' this software and associated documentation files (the "Software"), to deal in the
46+ ' Software without restriction, including without limitation the rights to use,
47+ ' copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
48+ ' Software, and to permit persons to whom the Software is furnished to do so,
49+ ' subject to the following conditions:
4850 '
49- ' The above copyright notice and this permission notice shall be included in all copies or
50- ' substantial portions of the Software.
51+ ' The above copyright notice and this permission notice shall be included in all
52+ ' copies or substantial portions of the Software.
5153 '
52- ' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
53- ' INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
54- ' PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
55- ' FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
56- ' OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
57- ' DEALINGS IN THE SOFTWARE.
58- 'endregion License ####################################################
54+ ' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
55+ ' IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
56+ ' FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
57+ ' COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
58+ ' AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
59+ ' WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
60+ 'endregion License ################################################################
5961
60- 'region DownloadLocationNotice ####################################################
61- ' The most up-to-date version of this script can be found on the author's GitHub repository
62- ' at https://github.com/franklesniak/sysadmin-accelerator
63- 'endregion DownloadLocationNotice ####################################################
62+ 'region DownloadLocationNotice #################################################
63+ ' The most up-to-date version of this script can be found on the author's GitHub
64+ ' repository at https://github.com/franklesniak/sysadmin-accelerator
65+ 'endregion DownloadLocationNotice #################################################
6466
65- 'region DependsOn ####################################################
67+ 'region DependsOn ##############################################################
6668 ' TestObjectForData()
67- 'endregion DependsOn ####################################################
69+ 'endregion DependsOn ##############################################################
6870
6971 Dim boolFunctionReturn
7072 Dim boolTest
@@ -89,10 +91,14 @@ Function TestObjectIsAnyTypeOfNumber(ByRef objToTest)
8991 Else
9092 On Error Goto 0
9193 If boolTest = True Then
92- ' VarType(objToTest) <> 2 And VarType(objToTest) <> 3 And VarType(objToTest) <> 4 And VarType(objToTest) <> 5 And VarType(objToTest) <> 17 And VarType(objToTest) <> 20
94+ ' VarType(objToTest) <> 2 And VarType(objToTest) <> 3
95+ ' And VarType(objToTest) <> 4 And VarType(objToTest) <> 5
96+ ' And VarType(objToTest) <> 17 And VarType(objToTest) <> 20
9397 boolFunctionReturn = False
9498 Else
95- ' VarType(objToTest) = 2 Or VarType(objToTest) = 3 Or VarType(objToTest) = 4 Or VarType(objToTest) = 5 Or VarType(objToTest) = 17 Or VarType(objToTest) = 20
99+ ' VarType(objToTest) = 2 Or VarType(objToTest) = 3
100+ ' Or VarType(objToTest) = 4 Or VarType(objToTest) = 5
101+ ' Or VarType(objToTest) = 17 Or VarType(objToTest) = 20
96102 boolFunctionReturn = True
97103 End If
98104 End If
0 commit comments