您的位置:首页 > 其它

第二章 物理层(ATM教程)

2008-08-23 11:32 218 查看
ASP 定义常量的方法
常量:用一种名称代替数字和字符串,且其值保持一直不变。
在 VBscript 中,可以用 const 语句来定义常量。
常量分数字型和字符串型。
表示日期的常量写在两个 # 之间。
示例:

以下为引用内容:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title> ASP 定义常量 </title>
</head>
<body>

<%
const a=123456789 //定义的常量为数字
const b="<hr width=120 align='left'/>定义常量<hr width=120 align='left'/>>" //定义的常量为字符串
const c=# 2010-01-16 # //日期要写在两个# 之间

response.Write a
response.Write b
response.Write c
%>

</body>
</html>
运行结果:
123456789

定义常量

2010-01-16
本文链接:http://www.oversteper.com/wprogram/asp/826.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: