Browse Subversion Repository
Contents of /trunk/doc/en/html/macro/command/getipv4addr.html
Parent Directory
| Revision Log
Revision 8939 -
( show annotations)
( download)
( as text)
Thu Oct 1 16:06:58 2020 UTC
(3 years, 7 months ago)
by nmaya
File MIME type: text/html
File size: 1793 byte(s)
マクロコマンドが Tera Term バージョンいくつから存在するか、それぞれのマクロコマンドのヘルプページに記載
ticket #40808
MFT to: 4-stable
| 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=iso-8859-1"> |
| 6 |
<title>getipv4addr</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>getipv4addr</h1> |
| 15 |
|
| 16 |
<p> |
| 17 |
Retrieves local IPv4 address(es). <em>(version 4.78 or later)</em> |
| 18 |
</p> |
| 19 |
|
| 20 |
<pre class="macro-syntax"> |
| 21 |
getipv4addr <string array> <intvar> |
| 22 |
</pre> |
| 23 |
|
| 24 |
<h2>Parameters</h2> |
| 25 |
|
| 26 |
<dl> |
| 27 |
<dt class="macro">String array <string array></dt> |
| 28 |
<dd>IP addresses are stored in the string array.</dd> |
| 29 |
|
| 30 |
<dt class="macro">Integer variable <intvar></dt> |
| 31 |
<dd>IP address counts. If the IP address is none, it is set to 0.</dd> |
| 32 |
</dl> |
| 33 |
|
| 34 |
<h2>Return Value</h2> |
| 35 |
|
| 36 |
<dl> |
| 37 |
<dt class="macro">System variable <result></dt> |
| 38 |
<dd>When the IP addresses are retrieved, it is set to 1.<br> |
| 39 |
When the IP address counts is bigger than the <string array> entries, it is set to 0.<br> |
| 40 |
When the IP address can not retrieve, it is set to -1.</dd> |
| 41 |
</dl> |
| 42 |
|
| 43 |
<h2>Example</h2> |
| 44 |
|
| 45 |
<pre class="macro-example"> |
| 46 |
ipaddr_size = 10 |
| 47 |
strdim ipaddr ipaddr_size |
| 48 |
|
| 49 |
getipv4addr ipaddr num |
| 50 |
if result = -1 then |
| 51 |
messagebox 'Error' 'IPv4 address' |
| 52 |
elseif result = 0 then |
| 53 |
N = ipaddr_size - 1 |
| 54 |
for i 0 N |
| 55 |
messagebox ipaddr[i] "IPv4 address" |
| 56 |
next |
| 57 |
N = num - ipaddr_size |
| 58 |
sprintf2 str "And %d address(es)." N |
| 59 |
messagebox str "IPv4 address" |
| 60 |
else |
| 61 |
N = num - 1 |
| 62 |
for i 0 N |
| 63 |
messagebox ipaddr[i] "IPv4 address" |
| 64 |
next |
| 65 |
endif |
| 66 |
|
| 67 |
</pre> |
| 68 |
|
| 69 |
<h2>See also</h2> |
| 70 |
<ul> |
| 71 |
<li><a href="getipv6addr.html">getipv6addr</a></li> |
| 72 |
</ul> |
| 73 |
|
| 74 |
</body> |
| 75 |
</html> |
|