A really dumb question. (1 Viewer)

John Sh

Member
Local time
Tomorrow, 07:07
Joined
Feb 8, 2021
Messages
410
I occasionally see things like "#constant" or "#If"
What does the "#" signify, and, likewise the "$" that precedes a line of code?
It seems a "$" after a variable declaration indicates a string variable.
Search as I may, I am unable to find much, any, information on either of these symbols.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 14:07
Joined
Oct 29, 2018
Messages
21,476
For the first question, try searching for "compiler directives."
 

theDBguy

I’m here to help
Staff member
Local time
Today, 14:07
Joined
Oct 29, 2018
Messages
21,476
For the second question, is ithe $ really after a variable or after a function name?
 

isladogs

MVP / VIP
Local time
Today, 22:07
Joined
Jan 14, 2017
Messages
18,239
likewise the "$" that precedes a line of code?
Can you give an example of this?

It seems a "$" after a variable declaration indicates a string variable.
This is correct for functions e.g. Left returns a variant; Left$ returns a string. Similarly Mid & Mid$

It can also apply to variables using Identifier Type Characters:
1697671823087.png


These characters are less commonly used than was the case 20+ years ago
 

John Sh

Member
Local time
Tomorrow, 07:07
Joined
Feb 8, 2021
Messages
410
likewise the "$" that precedes a line of code?
Can you give an example of this?

Not at the moment. It is something I have rarely seen and was a bit, lot, curious.
Once again I thank you for your informative response.
John
 

Users who are viewing this thread

Top Bottom