Search Tools Links Login

Possible error in VB6 Compiler


Visual Basic 6, or VB Classic

This is possebly an error in the VB6 compiler but i have turned it into a way to find out if you are in the IDE or Compiled version.

Original Author: Marco v/d Berg

Code

Just simple arithmatic can give different values in IDE-mode ore EXE-mode.

Insert this piece of code into a module and call the function IsIde.
it will return true if the programm is running in IDE-mode and false if running in EXE-mode (Compiled).

Take a look at the code and find out if this is an error or not.



Option Explicit
Private Test As Long
Public Function IsIde() As Boolean
Test = 4
Test = (Test + 1 + GetVal)
If Test = 9 Then IsIde = True
'Test will give 9 if IDE and 10 if EXE
'This can be done with any initial value but ofcourse you get other results
End Function
Private Function GetVal() As Long
GetVal = 4
Test = Test + 1
End Function

About this post

Posted: 2003-06-01
By: ArchiveBot
Viewed: 131 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.