VBA Internals: String Variables and Pointers in Depth

May 31, 2013 in VBA

This is the next installment of a series of deep-dives into the structure and implementation of variables in Visual Basic for Applications. For the previous posts, see the following: What’s in a variable – Categories of variables in VBA, by implementation Getting Pointers – Overview of how to obtain pointers in VBA Scalar Variables and Pointers in Depth – Details of numeric scalar variables and pointers In this post, I will cover the details of string variables and pointers. See Scalar Variables and Pointers in Depth for additional background and for the code for the utility functions HexPtr and Mem_ReadHex.
…read more

VBA Internals: What’s in a variable

May 6, 2013 in VBA

Language designers and runtime authors are always telling us to ignore implementation details. For the most part, including for VBA, that’s good advice. But sometimes you need or want know how things really work under the covers. In VBA this often arises when importing windows API functions which require pointers. To really understand pointers in VBA you first have to understand variables in VBA. In this article I’ll delve into the gritty implementation details of variables in VBA. VBA background Language vs runtime: An aside on terminology The VBA language and the VB runtime are not technically the same thing.
…read more