• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

anyway to check if a variable is a certain data type in VB6.0?

There is no way to discern type of primitives (Integer, Long, Short, Boolean, ...) in such a manner. This is in stark contrast in "true" OO languages.

You can, however, discern the type of classes/user-defined interfaces using the following syntax:

Dim yourObject As New YourClass

If TypeOf yourObject Is YourClass Then
' ...

HTH
 
Originally posted by: Descartes
There is no way to discern type of primitives (Integer, Long, Short, Boolean, ...) in such a manner. This is in stark contrast in "true" OO languages.

You can, however, discern the type of classes/user-defined interfaces using the following syntax:

Dim yourObject As New YourClass

If TypeOf yourObject Is YourClass Then
' ...

HTH


Sorry, that's wrong 🙂

Use the TypeName function which returns the variable's type.
If you did "Dim x As Integer", then "MsgBox (TypeName (x))" will pop up a message box saying "Integer".

 
Back
Top