Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does the 'bang' operator (!) in VB6 mean anything if it is merely on the end of a variable/number? If so, what does it mean?

Tags:

operators

vb6

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.

like image 222
Mike Webb Avatar asked Oct 24 '25 16:10

Mike Webb


1 Answers

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
like image 162
jdigital Avatar answered Oct 27 '25 00:10

jdigital



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!