I am working on some VB6 code at work and frequently come across variables, and sometimes numerical values ending with '!'. For example (note the '!' at the end of myVar! and the second 2!:
dist! = Sqr(x ^ 2 + y ^ 2!)
This is a line from the code I am working on. Does the '!' hold any meaning here? I would assume it does, because why use it otherwise, but can't find any documentation on this particular use.
It's no an operator, it's a type indicator. An Exclamation/Bang at the end of the name indicates a variable that can hold single precision floating point value. Here's a list of VB type indicators (may not be complete):
$ - string
% - integer
& - long integer
! - single precision floating point
# - double precision floating point
@ - currency
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With