I'm currently developping a project in VBA and I noticed the following bug :
If I have a property exist which returns a boolean of a class myClass. The following expression is mis-evaluated :
Dim myObj As New myClass: If myObj.exist Then debug.print ".. is evaluated to True even if exist does return False"
Note that If Not myObj.exit Then.. is identical to If myObj.exist Then..Using a Function instead of a Property Get has no difference, but it solved the issue if I declare a temporary variable
Dim flag As Boolean: flag = myObj.exit
If flag Then debug.print ".. is only evaluated if flag = True"
Of course, this alternative is not acceptable as it eventually requires many temporary variable.
Note that I didn't have this issue in CATIA V5R21 32 bits, nor in Excel (both 32 and 64 bits). Unfortunately, I haven't managed to reproduce this issue on a basic set of instructions (I have over quite a few classes). Does anyone have an idea about this issue ?