<< Click to Display Table of Contents >> Navigation: 3. Script Language > Internet and Network > Internet and Network Commands |
MiniRobotLanguage (MRL)
GCN. Command
Get Computer Name
Intention
Can be used to get the computer name of the actuals computer we are running on. '
Can also be used to get the hostname of any other computer, if we provide the IP address. Note that a DNS may be needed for this to work.
Syntax
GCN.[P1][|P2]
Parameter Explanation
P1 - (optional) Variable for Result. If omitted result is been placed on stack. Even if provided, there is additional Information on the stack.
P2 - (optional). IP-Address of which we ant to get the Host-Name. If omitted the actual computer is been used.
' Will compute actual computers hostname and place
' informations on the stack.
GCN.
' Will compute actual computers hostname and place it
' in variable $$RES. There will be further informations
' on the stack.
GCN.$$RES
' Will compute another computers computers hostname and place it
' in variable $$RES. There will be further informations
' on the stack.
' Note that a DNS may be needed for this to work.
: $$IPA=82.156.106.219
GCN.$$RES|$$IPA
' Will compute another computers computers hostname and place it
' in on the stack.
' Note that a DNS may be needed for this to work.
: $$IPA=82.156.106.219
GCN.|$$IPA
' Will compute another computers computers hostname and place it
' in on the stack.
' You can provide the IP-Address in a numeric format also.
' Note that a DNS may be needed for this to work.
: $$IPA=16777343
GCN.|$$IPA
This is how the stack looks like, if you provide 127.0.0.1 or 16777343 as IP-Address, and also provide a variable for the hostname.
This is how the actual stack looks, if you do not provide a variable for the result. You see the hostname on TOS.
Example
'-----------------------------------------------------------
' GCN. - Get Computer Name
'
' Without Parameter
' Result on the stack
GCN.
DMP.6
MBX. Next with Result in variable
STS.CLEAR
GCN.$$IPA
DMP.6
MBX. The IP-Adress is $$IPA
STS.CLEAR
' Now we try to get "another" computers Name
' from IP-Adress
: $$IPB=127.0.0.1
GCN.$$IPA|$$IPB
DMP.6
MBX. The IP-Adress is $$IPA
STS.CLEAR
' Now we try to get "another" computers Name
' from IP-Adress as number
: $$IPB=16777343
GCN.$$IPA|$$IPB
DMP.6
MBX. The IP-Adress is $$IPA
ENR.
Remarks
Limitations:
Depending on circumstances, a DNS-Server may be needed to get the host-name of IP addresses outside the local network.
See also: