开发者

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?

开发者 https://www.devze.com 2023-04-05 03:36 出处:网络
I am working on some VB6 code at work and frequently come acr开发者_开发技巧oss variables, and sometimes numerical values ending with \'!\'. For example (note the \'!\' at the end of myVar! and the se

I am working on some VB6 code at work and frequently come acr开发者_开发技巧oss 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
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号