Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the ampersand and $ symbol mean in the following contexts?

I'm in the process of a code review and have come across this:

Dim lngLen As Long    
lngLen = 16&

I have done some reading and it appears to be that this is a way of casting the number to a long - is that correct?

But is that really necessary here as you can just assign lngLen the value of 16 because it's a numeric value.

Also, following this code this is done:

Dim strCompName As String   
strCompName = String$(lngLen, 0&)

I realize the String method, from the Access help definitions, "returns a variant containing a repreating character string of the length specified."

So what does the $ do? And again is the & casting the 0 to a long?

like image 391
Katana24 Avatar asked Feb 16 '23 17:02

Katana24


1 Answers

Hi you can check this question for a possible answer to your query.

Edit: Moreover, I was able to scour the internet for more resources and I found this VBA typing convention which originally found on this forum page.

Hopefully this would help you.

like image 123
KevinIsNowOnline Avatar answered Apr 06 '23 18:04

KevinIsNowOnline