VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Possible error in VB6 Compiler

by Marco v/d Berg (7 Submissions)
Category: VB function enhancement
Compatability: VB Script
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (8 Votes)

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.

Rate Possible error in VB6 Compiler

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

Download this snippet    Add to My Saved Code

Possible error in VB6 Compiler Comments

No comments have been posted about Possible error in VB6 Compiler. Why not be the first to post a comment about Possible error in VB6 Compiler.

Post your comment

Subject:
Message:
0/1000 characters