Browse Subversion Repository
Contents of /trunk/doc/jp/html/macro/command/str2code.html
Parent Directory
| Revision Log
1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" |
2 |
"http://www.w3.org/TR/html4/strict.dtd"> |
3 |
<html> |
4 |
<head> |
5 |
<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS"> |
6 |
<title>str2code</title> |
7 |
<meta http-equiv="Content-Style-Type" content="text/css"> |
8 |
<link rel="stylesheet" href="../../style.css" type="text/css"> |
9 |
</head> |
10 |
|
11 |
<body> |
12 |
|
13 |
|
14 |
<h1>str2code</h1> |
15 |
|
16 |
<p> |
17 |
文字列を ASCII コード値に変換する。 |
18 |
</p> |
19 |
|
20 |
<pre class="macro-syntax"> |
21 |
str2code <intvar> <string> |
22 |
</pre> |
23 |
|
24 |
<h2>解説</h2> |
25 |
|
26 |
<p> |
27 |
文字列 <string> が1文字の場合、その文字の ASCII コードを整数変数 <intvar> に格納する。<br> |
28 |
<string> の長さが2以上の場合、<string> をその ASCII コード列に変換し、それを <intvar> に格納する。 <intvar> は最大 4 個の ASCII コードを格納できる。<br> |
29 |
もし <string> の長さが 4 文字より長い場合、ASCII コード列の最後の 4 バイトが <intvar> に格納される。 |
30 |
</p> |
31 |
|
32 |
<h2>例</h2> |
33 |
|
34 |
<pre class="macro-example"> |
35 |
str2code val 'A' |
36 |
; val=65 ("A" のASCII コード) |
37 |
|
38 |
str2code val 'AB' |
39 |
; val=65*256+66 |
40 |
</pre> |
41 |
|
42 |
</body> |
43 |
</html> |
|