VBScript Oct関数


VBScript 参考手册完全な VBScript リファレンスマニュアル

Oct 関数は、指定された数値の8進値を表す文字列を返します。

注意:引数が整数でない場合は、演算の前に四捨五入して最も近い整数にします。

構文

Oct(number)

引数 説明
number 必須。任意の有効な式。

数値が次の場合:

  • Null - その場合、Oct 関数は Null を返します。
  • Empty - その場合、Oct 関数は 0(ゼロ)を返します。
  • Any other number - その場合、Oct 関数は11個の8進文字を返します。

例

例

<script type="text/vbscript">

document.write(Oct(3) & "<br />")
document.write(Oct(5) & "<br />")
document.write(Oct(9) & "<br />")
document.write(Oct(10) & "<br />")
document.write(Oct(11) & "<br />")
document.write(Oct(12) & "<br />")
document.write(Oct(400) & "<br />")
document.write(Oct(459) & "<br />")
document.write(Oct(460) & "<br />")

</script>

上記の例の出力結果:

3
5
11
12
13
14
620
713
714

試してみる »

VBScript 参考手册完全な VBScript リファレンスマニュアル その他の拡張