I will here attempt to elaborate on the values of calling functions and other statements with variables defined By Value or By Reference. As a beginner one may find oneself rather confused by the different options and what impact they really have on the application you are currently engineering. In my personal experience, being referred to in many cases as a "speed freak, better off in another language than VB", I look to the issues of speed in execution.
We all know how tedious many tasks may seem when it comes to VB and the lack of really fast code to perform the simplest of efforts. Much more so when you call recursive loops or several If or For loops.
One step you may take is to choose a proper way of defining the reference point
and fastest way for your program to use the values of your constants and variables.
This is done by A) selecting the proper Variable Type and B) by defining the
variable ByVal
or ByRef
, when calling following statements.
The ByVal and ByRef Keywords are used in relation to the following statements.
Call, Declare, Function, Property Get, Property Let, Property Set, Su
b
In this tutorial/article I will only briefly describe the intricate details of these two keywords, in reference to the Function statement. The same applies to the others as well but for simplicity I will only use the most common here.
Comments