标题中的这个常量申明,不是会VB的人可能会不知道,比如--我。
查了半天搞明白啦,原来是强制转换为double啊~~
Msdn上查到的,还是贴出来,省得ms变地址得时候找不到。
查了半天搞明白啦,原来是强制转换为double啊~~
Msdn上查到的,还是贴出来,省得ms变地址得时候找不到。
The following example demonstrates correct usage of type characters and enclosing characters:
Option Strict Off Public Const DefaultInteger = 100 ' Default is Integer. Public Const DefaultDouble = 54.3345612 ' Default is Double. Public Const MyCharacter = "a"C ' Forces constant to be a Char type. Public Const MyDate = #01/15/01# ' Demonstrates DateTime constants. Public Const MyTime = #1:15:59 AM# Public Const MyLong = 45L ' Forces data type to be a Long. Public Const MySingle = 45.55! ' Forces data type to be a Single.
The following table shows the enclosing characters and type characters available in Visual Basic.
| Data type | Enclosing character | Appended type character |
|---|---|---|
| Boolean | (none) | (none) |
| Byte | (none) | (none) |
| Char | " | C |
| Date | # | (none) |
| Decimal | (none) | D or @ |
| Double | (none) | R or # |
| Integer | (none) | I or % |
| Long | (none) | L or & |
| Short | (none) | S |
| Single | (none) | F or ! |
| String | " | (none) |

浙公网安备 33010602011771号