ReefPicker 0 Newbie Poster

Thanks! Sorry, I got the dates mixed up... I honestly did think that it was more recent... It actually came up on a search I was doing trying to find out if anyone had a solution for an "annoyance" that I had encountered in VB6... So it was a webot that retrieved it ;)

PD If you are wondering what the annoyance was, it has to do with using any of the graphic methods on a PICTURE object... Sometimes upon stopping for debugging, when I attempt to return it sets an error "Wrong number of arguments or " blah blah... At first this baffled me, then I found out that by adding a remark (') to the offending code, running the application on the IDE, then stopping, removing the remark, and re-running, then all was well.... So I know 100% sure it is a bug... I am surprised it has not been fixed for so long... and that nobody else seems to have encountered it....!!

ReefPicker 0 Newbie Poster

Add a button, and 2 labels...(I've done this without a form too, using sub main() with debug.prints, but the difference is negligible)

Private Sub Command1_Click()
Dim retval As Double

Label1.Caption = Time
Me.Refresh

For I = 0 To 100000000
    retval = I * I
Next I

Label2.Caption = Time
Me.Refresh
End Sub

You need to define I as a double, otherwise it will be declared as a VARIANT and it will run much slower. As is, this code took 4 seconds to run. Changing the I to a DOUBLE shaved 2 seconds. This is, of course, on the IDE. Creating an executable should increase the speed of the loop even further.

To be perfectly honest, the inability to use pointers is annoying as all hell (addressof, for real?). What about strings.... what about how strings are always duplicated no matter what?

Pointers do exist in VB, as you have indicated. How they work and how they are implemented is completely different. VARPTR for example will return the pointer to a variable and there is an undocumented array pointer function as well.

Form_Unload very hardly does justice to a destructor, and Form_Load is a poor example of a constructor. To be honest, I don't use windows, I use *nix only (well, ok, so I have a virtualbox with XP in it, but eah).

I think that Form Load and Form Unload are not intended to be anything more than event-driven functions. They are no part of the OOP toolset …