Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15067

Syntax Styles, Shortcuts and binding in VBA

$
0
0
I have a questions that i think have obvious answers but i just wanted to ask some of you guys here.

I come accross every now and then someone who uses a convention in VBA syntax that almost looks like its obfuscated. Its all late bound with no complete declarations and variable symbols are used instead. for example

Code:

Function ListPaths(dic)
    Dim s$, v
    For Each v In dic
        s = s & v & " --> " & dic(v) & vbLf
    Next
    ListPaths = s
End Function

Ive been programming for decades and this syntax looks foreign to me until i start breaking it down. but i kind of like its conciseness but it just looks difficult to follow.

What are the benefits of coding like this? im particularly interested in the '$' used to declare the string and can use that technique to also return a string!?

Viewing all articles
Browse latest Browse all 15067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>