chr → 將數值轉成字元
(如無法正常測試,建議使用IE瀏覽器)
<script language="vbscript">
<!--
sub run_chr()
if isNumeric(trim(document.all("chr1").value)) then
document.all("chr2").value = "chr(" & document.all("chr1").value & ")"
document.all("chr3").value = chr(document.all("chr1").value)
document.all("lblchr").innerHTML = "執行成功!"
else
document.all("chr1").value = ""
document.all("chr2").value = ""
document.all("chr3").value = ""
document.all("chr1").focus
document.all("lblchr").innerHTML = "參數輸入錯誤!請重新輸入。"
end if
end sub
-->
</script>
<br />
<table>
<tbody>
<tr>
<td>函數</td><td>參數</td><td>執行</td><td>函數寫法</td><td>函數值</td><td>訊息</td>
</tr>
<tr>
<td>chr</td>
<td><input id="chr1" name="chr1" size="3" type="text" /></td>
<td><input id="btnchr" name="btnchar" onclick="run_chr()" type="button" value="執行" /></td>
<td><input id="chr2" name="chr2" size="10" type="text" readonly /></td>
<td><input id="chr3" name="chr3" size="5" type="text" readonly /></td>
<td><label id="lblchr" name="lblchr"></label></td>
</tr>
沒有留言:
張貼留言