VBScript 的数据类型统一为 Variant,其包含的子类型有:
| 子类型 | 意义 |
|---|---|
| Empty | 空,数据为 0,字符串为 "" |
| Null | 不含任何有效数据 |
| Boolean | 布尔值,true 或 false |
| Byte | 字节 0-255 |
| Integer | 整数 -32768 到 32767 |
| Currency | 货币 -922,337,203,685,477.5808 到 922,337,203,685,477.5807 |
| Long | 长整数-2,147,483,648 到 2,147,483,647 |
| Single | 单精度浮点数 |
| Date
Time |
日期型 #1-1-100# 到 #12-31-9999#
时间型 #0:0:0# 到 #23:59:59# |
| String | 变长字符串"str", 'str', 'It''s a book' |
| Object | 对象 |
| Error | 错误对象 |
| Dim Arr(), Ar(10)
ReDim Arr(3) ReDim Arr(4,5) |
如 Request.Form 等。
| <script language=vbscript>
for each par in collection document.write "属性名为:" & par document.write "属性值为:" & collection(par) next </script> |