2019 VBA reference - equivalents for Autoit, C++ and Java function and keywords

Author: Jeffrey Paesch

This page is started on March 10, 2019. The idea is to provide techniques, function to equivalents well know programming language functions and or statements.
You will enjoy this page, especially if you are the guy that translate code to another code Language,

==========================================================
Return x 
Description: exit function and return a value (java, autoit, and more)
Solution:  functionname = x: exit function (on the same line)
Example:
.    function (arg1,....)
.        if arg1 = "" then myfunction = -1: exit function
.        .......
.        ....
.    end function
==========================================================
void mysub( const int i );.
Description: passing const variable (as of C++) to VBA function. Link with detailed description
Solution: create a local (scope) variable within your function and capture the function byref variables
Example:
.    function (arg1,const_arg1 as integer, const_arg2 as boolean)
.        Dim arg1as integer, arg2 as boolean
.        arg1 = const_arg1,
.        arg2 = const_arg2
.        ' work from here with the local variables arg1 and arg2,
.        .......
.        ....
.    end function
==========================================================
more to come


No comments:

Post a Comment