小问题:关于asp常量的

yangtom 2002-01-15 02:18:23
在asp(VBScript)中定义常量:
Const cmaxsize=34 是可以的
可是我想定义一个常量的值是表达式;如2*1024等怎么把表达式值附给cmaxsize???
...全文
68 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
yangtom 2002-01-16
  • 打赏
  • 举报
回复
看了是死贴了。
yangtom 2002-01-16
  • 打赏
  • 举报
回复
Const cmaxsize=2*1024为什么不对??
BrightEye 2002-01-15
  • 打赏
  • 举报
回复
当字符串对待吧.否则IIS会自动运算的.
yangtom 2002-01-15
  • 打赏
  • 举报
回复
我就得可以就是不通!气人~~
KnowLittle 2002-01-15
  • 打赏
  • 举报
回复
好奇怪,真的不行。
但是msdn说可以的:
[Public | Private] Const constname = expression

Arguments
Public

Optional. Keyword used at script level to declare constants that are available to all procedures in all scripts. Not allowed in procedures.

Private

Optional. Keyword used at script level to declare constants that are available only within the script where the declaration is made. Not allowed in procedures.

constname

Required. Name of the constant; follows standard variable naming conventions.

expression

Required. Literal or other constant, or any combination that includes all arithmetic or logical operators except Is.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧