Sub vs Function Execution (as Compared to VB6)

JDYoder

Centurion
Joined
Nov 18, 2003
Messages
144
Long ago, I was told in VB6 if you had a rare instance where sometimes the execution of a sub wasn't quite finished (because of buffers and/or where you were using DoEvents to help the program "catch up" to what it's been told) that you should change it to a function because it will completely finish everything before releasing control back to where it was called.

First of all, is that true in VB6? And second, is that the case in .NET?
 
Unless you are doing things with threads then execution is purely synchronous - a method call (sub or function) completes before it returns and execution can continue. DoEvents simply lets your application process it's windows messages and shouldn't alter this in any way (apart from the odd exception like your application exiting etc.)

I honestly have no idea if this is true in vb6 or not but it sounds highly unlikely (then again vb6 was odd in places;))
 
Back
Top