| Contents | Previous Page | Next Page |
' -- // auto ftp auto lf auto refresh bye call script char width char zoom clear log clear script clear triggers clear var clear vars connect copy copy selection dec decrement default log default script disconnect else elsif empty log endif error email attachments email authtype email body email close email connect email disconnect email end email files email finish email from email host email memo email message email open email password email port email quit email reply email send email signon email subject email text email to email userid exec execute exit font ftp abort ftp ascii ftp binary ftp connect ftp disconnect ftp get ftp host dir ftp host file ftp host name ftp local file ftp password ftp port ftp put ftp quit ftp receive ftp send ftp timeout ftp transmit ftp username ftp wait goto graphics hostname if inc increment line height line zoom list load log load script local echo log log append log commands log errors log line log name log screen lower lpad max message min msg oem charset pause port print file print list quit refresh screen rem return from script rows run save log screen height screen width script height script name script return script visible selection send set shell standard keys std keys stop system trigger trigger delete trim typing upper upper lock wait
FTP (copy) a file from one machine to another, setting up session on one line of script
|
AUTO FTP Hostname,Port,UserId,Password,LocalFile,RemoteFile,[BIN|ASC],[T|R] where Hostname is the same as executing command FTP HOST NAME hostname and Port is the same as executing command FTP PORT Port and UserId is the same as executing command FTP USERNAME UserId and Password is the same as executing command FTP PASSWORD Password and LocalFile is the same as
executing command FTP
LOCAL FILENAME LocalFile and RemoteFile is the same as executing command FTP HOST DIR/FILENAME RemoteFile Nb.RemoteFile
is split into directory / filename components automatically by ArcTel and using BIN is the same as executing
FTP BINARY and using ASC is the same as executing FTP ASCII and using T is the same as executing FTP TRANSFER to transfer file to host computer and using R is the same as executing FTP RECEIVE to retrieve file from host computer. |
This command incorporate many of the other FTP commands into one line of script. It is particularly useful if wishing to transfer a file using the EXEC statement of the command-line parameters (i.e. when executing ArcTel).
With this command, you set all the important information required to perform a file transfer, and then state which direction the file is going (Transferred to Remote machine or Received from Remote machine). The machines are then connected, and the transfer commenced. On completion, the transfer is closed
|
Arctel MIN EXEC AUTO FTP ftp.mydomain.co.uk,ftp,guest,letmein,c:\transmit\transmit.txt,recv/receive.txt,ASC,T |
|
AUTO LF {TRUE | ON | ENABLED | OTHER} Enable using one of TRUE, ON, or ENABLED. Disable using anything else – e.g. FALSE, OFF, or DISABLED. |
Some terminals require the emulator to add a line feed at the end of each line. If you terminal seems to be running lines one after the other, instead of putting them onto separate line, enable this option.
|
AUTO REFRESH {TRUE | ON | ENABLED
| OTHER} Enable using one of TRUE, ON, or ENABLED. Disable using anything else – e.g. FALSE, OFF, or DISABLED. |
Changing many of the terminal settings affects the way the terminal looks. If making a series of changes, you may wish the screen to remain unchanged until the last change has taken place, in order to cut down the time spent needlessly updating the screen. Turn this option off to achieve this, or ON to make sure any such change gets automatically updated on the screen.
|
CALL SCRIPT filename where filename is the name of the script file that you wish to execute. |
This Loads and executes a script from within the current script, but keeping details of the current script in memory.
When execution of the called script terminates with the SCRIPT RETURN or RETURN FROM SCRIPT command, the called script is removed from memory, and execution resumes with the next line of the calling script.
It is possible to run other scripts from within a script, and when finished with that script, return control to the original script. This is a little like procedure calling in many programming languages.
Calls to scripts may be nested – there is no fixed limit to the depth of nesting. Be careful that you do not accidentally call a calling script from a called script, unless you have a specific exit condition to prevent two scripts infinitely calling each other.
Any triggers, variables, etc. that are set up in the called script, will be retained in memory.
This makes a called script useful as standard script that can be reused in other scripts, for example to set up a session and commonly used variables.
In the below example, the standard script login_prod.asf is called to log into a terminal, and then a task is performed (writing the directory contents to a file) before closing the session.
Calling Script
|
CALL
SCRIPT
login_prod.txt |
Call
script to log in to terminal in production mode. |
|
SEND
ls –alrt >dir.txt#cr# |
Run
the ls-alrt >dir.txt command
within the host computer’s environment. In this example, this puts a
directory listing of the current directory into a file dir.txt in the same directory on this host computer. |
|
SEND
exit#13##10# |
Tell
the host computer to exit and therefore terminate the connection |
|
WAIT
3 |
Wait
for three seconds to make sure everything has terminated OK. |
Script: login_prod.asf
|
SET
cr=#13##10# |
Set
up a variable called #cr# to represent a carriage return. |
|
CLEAR
TRIGGERS |
Ensure
there are no outstanding triggers in memory |
|
HOSTNAME
123.456.789.0 |
Set
remote computer as having IP address of 123.456.789.0 |
|
TRIGGER
1,login,USER1#cr#,login |
When
the terminal displays login,
send the text USER1 followed by a carriage return, and start the script at
the line marked login: |
|
CONNECT |
Connect
to computer 123.456.789.0 |
|
STOP |
Terminate
the script. The script will be restarted at the line marked login:
when the terminal displays the text login |
|
login: |
Start
here when TRIGGER #1 (text login)
is activated |
|
TRIGGER
2,password:,#DECRYPT 3OQ*N&P#cr#,password |
Second
trigger: When the text password:
is encountered, output the password followed by a carriage return, and go
to line labelled password: in
script. |
|
CONNECT |
Connect
to computer 123.456.789.0 |
|
STOP |
Terminate
the script. The script will be restarted at the line marked login:
when the terminal displays the text login |
|
login: |
Start
here when TRIGGER #1 (text login)
is activated |
|
STOP |
Terminate
the script. The script will be restarted at the line marked password:
when the terminal displays the text password: |
|
password: |
Start
here when TRIGGER #2 (text password)
is activated. |
|
TRIGGER
3,Select Environment,p#cr#,production |
Third
trigger. When the text Select
Environment is encountered, send a p
for production followed by a carriage return, and then start the script at
the label production: |
|
STOP |
Terminate
the script. The script will be restarted at the line marked production:
when the terminal displays the text Select
Environment |
|
production: |
Start
here when TRIGGER #3 (text Salect
Environment) is activated. |
|
CLEAR
TRIGGERS |
Clear
triggers to make sure not triggered by accident at any other time. |
|
SCRIPT
RETURN |
Return
to calling script |
|
CHAR WIDTH char_width where char_width is the width of a character column on the terminal in pixels. |
If you increase the size of the font, it will also be necessary to increase the size of the character width, otherwise the font will be cut off in width.
You can also use this option to increase the spacing between character columns to make them more readable.
|
CHAR ZOOM zoom_amount[%] where zoom_amount is the amount to zoom the spacing by (where 1 is no zoom). To make this a percentage value, add a % symbol (no zoom then being 100%) |
If you find the characters are not wide enough, making the screen look narrow, then you may like to increase the character zoom – e.g. 2 or 200% (for 200%) would make the characters twice as wide, and 0.5 or 50% (for 50%) would make them twice as small. See also LINE ZOOM.
Define the number of character columns displayed on the terminal screen
|
COLUMNS num_cols where num_cols is the number of columns of text that may be displayed on the terminal. |
This is generally set at 80 characters wide. Only increase / decrease it if you seem to miss columns of data or have too many blank columns at the right of the screen. Maximum column width is 132.
|
CLEAR LOG where num_cols is the number of columns of text that may be displayed on the terminal. |
To clear the log so that any future telnet activity is
recorded from a ‘clean slate’, use either of the above commands, both of
which perform the same function.
|
LOG ERRORS ON |
Log any errors |
|
LOG
SCREEN ON |
Log
anything that is transmitted/received during the session |
|
LOG
COMMANDS OFF |
Do
not log commands that are run in the script |
|
LOG
NAME c:\windows\std_telnet_log.alf |
Log
will be saved to file c:\windows\std_telnet_log.alf |
|
DEFAULT
LOG |
Log
c:\windows\std_telnet_log.alf is
the default log, which will automatically be loaded when ArcTel starts up. |
|
CLEAR
LOG |
Clear
the log of its contents |
|
SAVE
LOG |
Save
the log to the filename c:\windows\std_telnet_log.alf |
|
LOG
ENABLED |
Turn
logging on |
|
CLEAR SCRIPT |
This will remove all lines from the script on the screen. This may be useful to put at the end of your default script, so that the script edit box is clear to do further work.
|
CLEAR TRIGGERS |
This will remove all triggers from memory, so that no text being displayed will cause an event to be triggered.
This is useful for clearing up after the end of a script that uses triggers, or as a ‘make sure’ to put in at the beginning of a script that is to use a brand new set of triggers.
Remove a specified variable from memory.
|
CLEAR VAR varname where varname is the name of
the variable to remove from memory. |
This will remove any reference to the variable from memory. Attempting to retrieve the variable when it has been removed from memory will generate an error and cause the script to halt.
|
CLEAR VARS |
|
CONNECT |
On connection, most telnet services will prompt the user for a user name and password. To automate the login for these, see the section on Logon Automation in the Common Tasks section of this manual.
|
COPY src_str,from_index,to_index TO dest_var Where src_str is the source text terminated with a comma, from_index is the starting character position of the text to copy from the source text, to_index is the number of characters to copy from the source text, and dest_var is the name of the variable to put the extracted string into. |
For example, if you apply the command COPY hello,2,3 TO dest this will start from the second character (e) and copy three characters (e, l, and l) and place this into the variable called dest, so that dest now contains ell.
|
SET abc=1 |
Set
variable abc to 1 |
|
MESSAGE #abc# |
Displays
1 in a dialog box. Click on OK
to continue. |
|
INC abc |
Adds
1 to variable abc so now it
contains 2 |
|
MESSAGE #abc# |
Displays
2 in a dialog box. Click on OK
to continue. |
|
LPAD abc,4,0 |
Pad
out abc to a length of 4
characters with prefixed 0s. |
|
MESSAGE #abc# |
Displays
0002 in a dialog box. Click on
OK to continue. |
|
COPY #abc#,2,3
TO def |
Copies
characters 2 to 4 from abc and
place in variable def |
|
MESSAGE
def=#def# |
Displays
def=002 in a dialog box. Click
on OK to continue. |
|
DEC var_name where var_name is the name of an existing variable which contains a numeric value. |
For some purposes, you may want to decrement a numeric value stored in a variable during a process, for example if you are emulating a loop. Use this command to achieve this purpose.
The example below shows a message box for numbers 5 through to 1 in a loop, then quits the loop.
|
SET loopvar=5 |
Set loop variable |
|
loopstart: |
Start of loop |
|
MESSAGE Loopvar is #loopvar# |
Display ‘Loopvar
is 1’, etc. |
|
DEC loopvar |
Decrement loopvar
– take 1 from its value |
|
IF “#loopvar#” NUM>“0” |
If loop variable is numerically greater than 0 … |
|
GOTO loopstart |
… then go back to loopstart for the next
iteration |
|
ENDIF |
End of If condition block |
|
MESSAGE end of loop |
Display End of loop in a message box. |
|
COPY SELECTION |
If you wish to copy specific text from a given selected rectangle on the terminal, use this command. The text enclosed in the selection rectangle will be copied to the clipboard. You can access the text contents of the clipboard using the #clipboard# macro substitution.
The selection is set either by the user dragging around some given text using the mouse, or programatically using the SELECTION command.
|
DEFAULT LOG |
Make the current script filename the default
|
DEFAULT SCRIPT |
This will make the current script filename (e.g. previously
loaded or previously set using SCRIPT NAME
command) the default to be loaded up automatically when ArcTel is opened.
Nb. if you want the script to be automatically loaded up each time, but do not
wish it to be automatically run, make sure the first line of the script is NORUN
Disconnect (log off) from the remote computer that you are currently connected to.
|
DISCONNECT |
It is always good practice to log off cleanly if possible. Most telnet environments have a disconnection option which allows the remote host to clean up before disconnection – common command-line keywords in the host environment include exit bye quit q system
Specify a file or list of files using their filenames, to be sent with the email as attachment(s).
|
EMAIL ATTACH file_list EMAIL ATTACHMENT file_list EMAIL ATTACHMENTS file_list EMAIL FILE file_list EMAIL FILES file_list where file_list is a semi-colon separated list of file-names of files to be attached |
The file names must all exist and be valid files on or accessible by your PC.
Note that you can use a single filename, or a list of filenames separated by semi-colons. It is also possible to add to, merge into, delete from, load and save this list using the standard list-building facilities of Arctel, explained here.
This defines the authorization type required in order to log into the server.
|
EMAIL AUTHTYPE logontype where logontype is the type of authorization required in order to log into the server. It can be one of PLAIN, LOGIN or CRAMMD5 |
If you do not need to login to your email server using a password (generally true for computers within an organization - i.e. on an Intranet) then use the PLAIN option.
If you need to login to an email using a password, you would generally use the LOGIN option (generally true for computers connected to an external server on the Internet - e.g. an Internet Service Provider).
If you do use the LOGIN option, you will also need to use the EMAIL USERID and EMAIL PASSWORD options.
Close a connection - i.e. log off - the SMTP (Email sending) server previously logged in to.
|
EMAIL CLOSE EMAIL FINISH EMAIL END EMAIL DISCONNECT EMAIL QUIT |
This will log you off the server previously logged onto using the EMAIL OPEN command, having sent all the emails you wish to using the EMAIL SEND command.
Specify the email address from which the message was sent, and to which a reply should be sent.
|
EMAIL FROM emailaddr where emailaddr is the email address of the person to which replies should be sent |
The email address must be in the correct format to be transmitted across the Internet - e.g. webmaster@simonhuggins.com - note that you can use any email address, so you should be extra careful to use an address that actually exists - i.e. check for spelling mistakes etc. Note if you wish replies to go to an alternative address, use the EMAIL REPLY [TO] command after using the EMAIL FROM command.
Define the email host name or IP address of the SMTP server from which you wish to send an email
|
EMAIL HOST hostname EMAIL HOST NAME hostname where hostname is the name or IP address of the SMTP server. |
You need to specify the host name prior to connecting to the server. See the EMAIL SEND command for an example of sending an email.
Open a connection - i.e. log on to - the SMTP (Email sending) server previously specified.
|
EMAIL OPEN EMAIL CONNECT |
This will log you on to the server specified in the EMAIL HOST command using the EMAIL PORT port, authenticating the login using the user id and password specified in the EMAIL USERID and EMAIL PASSWORD commands (if the EMAIL AUTHTYPE LOGIN command was used). You can then send as many emails as you required before loggin off the server again using the EMAIL CLOSE command.
Specify the Password that authenticates the User ID, required to log into the SMTP email server in order to send an email.
|
EMAIL PASSWORD acctpass where acctpass is the password for the account required to log in to the SMTP server |
Required if you use the EMAIL LOGIN command to specify that you need to log in to your email server with an ID and Password to authenticate your rights to use the server. You will also need to use the EMAIL USERID command to specify the login account name.
Define the port number to be used to connect to the SMTP server from which you wish to send an email
|
EMAIL PORT portnumber where portnumber is the port number to use to connect to the SMTP server. |
If you do not know the port number, use the default smtp - the majority of SMTP servers use this for connection.
Specify the email address to which any replies should be sent.
|
EMAIL REPLY emailaddr EMAIL REPLY TO emailaddr where emailaddr is the email address of the person to which replies should be sent |
The email address must be in the correct format to be transmitted across the Internet - e.g. webmaster@simonhuggins.com - note that you can use any email address, so you should be extra careful to use an address that actually exists - i.e. check for spelling mistakes etc. Note make sure you use this command after using the EMAIL FROM command.
Send an email having specified the various details about the email
|
EMAIL SEND |
You need to have opened a connection to the SMTP server prior to issuing this command using the EMAIL OPEN command. You can send several messages, but must then issue an EMAIL CLOSE command to show that the last email has been sent (even if it was only a single email).
The following is an example of sending an email to a server with authentication:-
|
EMAIL HOST
smtp.simonhuggins.com |
Specify SMTP server to send email from |
|
EMAIL PORT smtp |
Specify the
port to use to connect to the SMTP Server - use the standard port in this
case. |
|
EMAIL AUTHTYPE LOGIN |
This server needs an account id / password to log into it and send an email |
|
EMAIL USERID simonh |
Account name to log in to SMTP server is simonh |
|
EMAIL PASSWORD #DECRYPT w 04*+-Aa14t+|e`5# |
Specify
password to log into SMTP server. Note the password has been turned into a
CryptString to dissuade prying eyes. |
|
Specify the email address where returned emails and replies should be sent |
|
|
EMAIL TO huggins@bogoff.net;"blurb" <blurb@simonhuggins.com> |
Specify two email addresses of people that will receive the email |
|
EMAIL SUBJECT Test message |
Give a subject line for the email, as it will appear in the recipients' inboxes |
|
EMAIL ATTACH c:\scandisk.log;c:\temp\email_test.asf |
Specify two attachment files to send with the email |
|
EMAIL TEXT First line;Second Line;Third Line;Fourth line is not duplicated |
Put fourth lines of text in the body of the email |
|
EMAIL MSG MERGE Fourth line is not duplicated;Fifth Line;Sixth line is deleted |
Fourth line is not added as it is 'MERGEd', fifth and sixth lines are added. |
|
EMAIL MESSAGE REMOVE Sixth line is deleted;This line is ignored |
Sixth line is removed again as it matches, next line is ignored as it isn't in the email body |
|
EMAIL BODY ADD Add this line;Fifth Line;Last line was just a test - see it is kept |
Add another line, and Fifth Line again (to show it is not merged), and another comment line |
|
EMAIL MEMO ADD The following lines are opened from the script file; |
Add another line of text followed by a blank line |
|
EMAIL TEXT ADD OPEN c:\temp\email_test.asf |
Add the text
contained in the file c:\temp\email_test.asf |
|
EMAIL TEXT ADD -----;;End of email body |
Add a separator line, a blank line and an 'end of message' indicator line |
|
EMAIL OPEN |
Open a connection to the SMTP mail server - i.e. 'log on' to it. |
|
EMAIL SEND |
Send the email message |
|
MSG #EMAILRES# |
Show a dialog-box message to indicate the result of the SEND |
|
EMAIL QUIT |
Close the connection to the SMTP server - i.e. 'log out' of it. |
Define the sign-on string to be used for a server. You can use this to determine specific data about a server.
|
EMAIL SIGNON signonstring where signonstring is the command request string to send to the server when logging on |
You will not usually need to use this command when sending an email.
Specify the subject line text that will appear in the recipient's inbox.
|
EMAIL TO text where text is a single line of text indicating the subject of the email to the recipient |
This is a single line of text used by the recipient to identify in their inbox the subject matter of the email. It should be kept concise, and explain clearly the content of the email in order to allow the recipient to appropriately prioritise its importance.
Specify the main body of text to be used for the email message.
|
EMAIL TEXT body_list EMAIL MSG body_list EMAIL MESSAGE body_list EMAIL BODY body_list EMAIL MEMO body_list where body_list is a list of lines that comprise the body text of the email to be sent |
The body text is made up of several lines of text to relay the main detailed information of your email message.
Note that you can use a single line of text, or a number of lines separated by semi-colons. It is also possible to add to, merge into, delete from, load and save these lines using the standard list-building facilities of Arctel, explained here. Note also that a comprehensive example of using the list-building facility to build up the body of the email is included with the EMAIL SEND command.
Specify the email address(es) of the recipients for the email message. I.e. where the email is to be sent.
|
EMAIL TO email_list where email_list is a semi-colon separated list of email addresses of the people to which the email is to be sent. |
The email address(es) must be in the correct format to be transmitted across the Internet - e.g. webmaster@simonhuggins.com.
Note that you can use a single email address, or a list of addresses separated by semi-colons. It is also possible to add to, merge into, delete from, load and save this list using the standard list-building facilities of Arctel, explained here.
Specify the account name (User ID) required to log into the SMTP email server in order to send an email.
|
EMAIL USERID username where username is account name required to log in to the SMTP server |
Required if you use the EMAIL LOGIN command to specify that you need to log in to your email server with an ID and Password to authenticate your rights to use the server. You will also need to use the EMAIL PASSWORD command to specify the login password.
|
ERROR message_text where message_text is the error message text to be displayed / logged. |
Use this command to display a specific error message, log it (if error logging is turned on) and terminate execution of the script.
|
FONT [NAME font_name] [,SIZE font_size]
[,BOLD status] [,ITALIC status] where font_name is the name of the font to use for the terminal. Generally fixed style fonts such as Courier New work better with terminals. font_size is the point size of the font to use. Between 8 and 12 is reasonable. status is one of TRUE, ON, or ENABLED to turn the effect on, or anything else (e.g. FALSE, OFF, or DISABLED) to turn the effect off. |
Use this command to set the terminal font, size, and style.
|
FONT
NAME Courier New,SIZE 10,BOLD ENABLED,ITALIC DISABLED |
Set
the font of the Terminal to be Courier new, point size 10, emboldened, but
with not italicization. |
|
FTP ABORT |
Use this command only if you wish to terminate an FTP transfer, or the connection cannot be shut down otherwise using the FTP QUIT command.
|
FTP ASCII |
Any files FTPed after using this command will be transferred in ASCII MODE. Use this mode to transfer text files.
|
FTP BINARY |
Any files FTPed after using this command will be transferred in BINARY MODE, ie. the destination file will be an exact copy of the source file.
|
FTP CONNECT |
Use this command to establish a connection between the local computer and the remote computer.
When you wish to transfer a file using FTP, you will need to set the HOST, PORT, USERNAME, PASSWORD, and specify the files to ftp to / from. You can then execute the FTP CONNECT command, use FTP GET or FTP PUT to transfer the file, and FTP QUIT to disconnect from the FTP server.
Note that the TRANSMIT and RECEIVE commands will automatically open a connection, so there is usually no need to use this command. However, if you use the GET or PUT commands, this will be necessary. For multiple transfers, using CONNECT/GET or PUT/QUIT will speed up the transfer by eliminating the need to form a new connection for each transfer.
|
FTP GET |
Use this command to transmit the file on the remote FTP server defined by the FTP HOST DIR and FTP HOST FILE to a file on the local machine defined by the commands FTP LOCAL FILENAME command. A connection must already have been established with the FTP CONNECT command. Use the FTP RECEIVE command if you wish to connection to be created and dropped automatically with each file transferred.
The sample script below shows how to transfer two files in one connection to avoid having to reconnect to the server: -
|
FTP
HOST NAME 123.123.123.1 |
Set
the IP address of the remote computer to transfer with |
|
FTP
PORT ftp |
Set
the port to the standard FTP port |
|
FTP
USERNAME guest |
Login
to the remote computer with a username of guest |
|
FTP PASSWORD me@my.co.uk |
Login
to the remote computer with a password for
the guest account of
me@myco.co.uk |
|
FTP
TIMEOUT 10 |
If
no activity for 10 seconds, then disconnect |
|
FTP
HOST DIR logs/ftp |
Change
to the remote directory logs/ftp |
|
FTP
HOST FILE results.txt |
File
on the remote server is called results.txt, and it is located in the logs/ftp
directory |
|
FTP
LOCAL FILENAME results.txt |
File
on the local computer (on which ArcTel is being run) will be called results.txt |
|
FTP
BINARY |
Transfer
the file as a direct copy of what's on the server |
|
FTP
CONNECT |
Connect
to the remote server |
|
FTP
GET |
Receive
the file from the remote server |
|
FTP
HOST FILE results2.txt |
File
on the remote server is called results2.txt, and it is located in the logs/ftp
directory, as before |
|
FTP
LOCAL FILENAME results2.txt |
File
on the local computer (on which ArcTel is being run) will be called results2.txt |
|
FTP
BINARY |
Transfer
the file as a direct copy of what's on the server |
|
FTP
GET |
Receive
the file from the remote server, still using the same connection as for
the first transferred file |
|
FTP
QUIT |
Quit
the FTP connection, as we've finished transferring the two files. |
Set the current directory on the host machine.
|
FTP HOST DIR dirname where dirname is the directory
name to use on the remote computer. |
Use this command to set the directory on which the file is to be transferred from / to on the remote computer. When you log in to a remote computer, you will be placed in a specific directory, most often not the root. Any directory you specify will be relative to this directory.
Set the filename of the file to transfer from / to on the
remote computer
|
FTP HOST FILE[NAME] filename where filename is the filename
of the file to use on the remote computer. |
Use this command to set the file that you are wished to transfer from, or into on the remote computer. Note that you should not include the directory or path in this name – use the FTP HOST DIR command to set this. The filename is usually case-sensitive.
Set the Host name or IP address for the remote FTP computer.
|
FTP HOST NAME hostname where hostname is the name of
the FTP computer to log onto. |
Use this command to specify the IP address or host name of the remote computer to log onto in order to transfer files.
If you have DNS services available, this can be in the form of (for example) ftp.myorg.co.uk or alternatively, in the form of an IP address –e.g. 120.130.140.1
Set the local filename of the file to transfer to / from the remote FTP computer.
|
FTP LOCAL FILENAME filename where filename is the filename
of the file on the local computer, with path. |
Use this command to set the file that you are wished to transfer from, or into on the local computer (the one you are running ArcTel from). Note that you should also include the directory or path in this name. The filename/path is usually case-sensitive.
|
FTP PASSWORD password where password is the password
for the user account, used to authenticate the person trying to log in to the
computer. |
The computer you are logging into will have different accounts set up with different authorities to restrict what different users can do. Each account is identified with a username and authenticated with a password.
This command sets the password for the account to log into on the remote FTP computer.
|
FTP PORT port where port is the port number
to use on the remote computer for FTP. Default is ftp |
When you wish to transfer a file using FTP, you will need to set the HOST, PORT, USERNAME, PASSWORD, and specify the files to ftp to / from.
The computer that you are logging into uses different ports for different processes. If you wish to use the default FTP port, set port to ftp otherwise, set port to the number of the port from which the telnet service is available.
Transmit the file from the local machine to the remote computer, given that a connection to the FTP server has already been established.
|
FTP PUT |
Use this command to transmit the file defined by the FTP LOCAL FILENAME command to a file on the remote FTP server defined by the FTP HOST DIR and FTP HOST FILE commands, given that a connection to the FTP server has already been established using the FTP CONNECT command. Use the FTP QUIT command afterwards to manually close the connection. Note, to create and close the connection automatically with each transfer, use the FTP TRANSMIT command.
Close the connection to the remote computer for FTP
|
FTP QUIT FTP
DISCONNECT |
Transmit the file from the remote computer to the local machine.
|
FTP RECEIVE |
Use this command to transmit the file on the remote FTP server defined by the FTP HOST DIR and FTP HOST FILE to a file on the local machine defined by the commands FTP LOCAL FILENAME command. The sample script below shows a typical set of commands for retrieving a file from a remote FTP server: -
|
FTP
HOST NAME 123.123.123.1 |
Set
the IP address of the remote computer to transfer with |
|
FTP
PORT ftp |
Set
the port to the standard FTP port |
|
FTP
USERNAME guest |
Login
to the remote computer with a username of guest |
|
FTP PASSWORD me@myco.co.uk |
Login
to the remote computer with a password for
the guest account of
me@myco.co.uk |
|
FTP
TIMEOUT 10 |
If
no activity for 10 seconds, then disconnect |
|
FTP
HOST DIR logs/ftp |
Change
to the remote directory logs/ftp |
|
FTP
HOST FILE results.txt |
File
on the remote server is called results.txt, and it is located in the logs/ftp
directory |
|
FTP
LOCAL FILENAME results.txt |
File
on the local computer (on which ArcTel is being run) will be called results.txt |
|
FTP
BINARY |
Transfer
the file as a direct copy of what's on the server |
|
FTP
RECEIVE |
Connect,
receive the file from the remote server, and disconnect all in one
command. |
|
'
FTP QUIT |
Notice
this has been commented out, so won't execute – there's no need to quit
the FTP session, as this is done as part of the FTP RECEIVE command. |
|
FTP TIMEOUT time_secs |
This command sets the length of time in seconds before the remote computer will be disconnected when the connection is inactive (e.g. because the connection has been lost or is on a very slow link).
Transmit the file from the local machine to the remote computer.
|
FTP TRANSMIT FTP SEND |
Use this command to transmit the file defined by the FTP LOCAL FILENAME command to a file on the remote FTP server defined by the FTP HOST DIR and FTP HOST FILE commands.
Set the user name of the user account on the remote computer to FTP to/from
|
FTP USERNAME username |
The computer you are logging into will have different accounts set up with different authorities to restrict what different users can do. Each account is identified with a username and authenticated with a password.
This command sets the user name of the account to log into on the remote FTP computer.
|
FTP WAIT |
The example below shows the setup of a sample FTP session,
and how to download a file from a remote computer. Typically, this is
unnecessary as file transfers are usually synchronous (happen one after the
other, rather as a background process).
|
FTP
HOST NAME 123.123.123.1 |
Set
the IP address of the remote computer to transfer with |
|
FTP
PORT ftp |
Set
the port to the standard FTP port |
|
FTP
USERNAME guest |
Login
to the remote computer with a username of guest |
|
FTP PASSWORD me@myco.co.uk |
Login
to the remote computer with a password for
the guest account of
me@myco.co.uk |
|
FTP
ASCII |
Transfer
the file as ASCII text, not binary data |
|
FTP
TIMEOUT 10 |
If
no activity for 10 seconds, then disconnect |
|
FTP
HOST DIR logs/ftp |
Change
to the remote directory logs/ftp |
|
FTP
HOST FILE results.txt |
File
on the remote server is called results.txt, and it is located in the logs/ftp
directory |
|
FTP
LOCAL FILENAME results.txt |
File
on the local computer (on which ArcTel is being run) will be called results.txt |
|
FTP
RECEIVE |
Receive
the file from the remote server |
|
FTP
WAIT |
Wait
until the command has completed |
|
FTP
QUIT |
Quit
the FTP session, disconnecting from the remote computer. |
|
GOTO line_label[,alt_line_label] also alt_line_label is the [optional] alternative line to go to, if line_label is not found. |
To skip to another part of the script, place a line containing a line_label followed by a colon (:) and jump to it by using GOTO line_label. If you are using a macro-substitution in line_label, there is a possibility that the line label won’t be found, in which case, specify an alt_line_label to jump to in case it isn’t found.
Take the below sample, which prompts the user for an IP
address, but only allows either 123.456.789.0 or 321.321.321.1 otherwise a
message is displayed.
|
SET ip_addr=#PROMPT IP Address,123.456.789.0# |
Prompt user for an IP address, with a default of
123.456.789.0 and places it in variable ip_addr |
|
GOTO ip(#ip_addr#),not_found |
Go to a label matching the contents of
ip_addr. If not matched,
GOTO label not_found: |
|
not_found: |
label
for GOTO statement |
|
MESSAGE
IP Address '#ip_addr#' not recognized. Cannot connect. |
Show
warning message that cannot connect. Could use ERROR instead of MESSAGE to
log as an error. |
|
STOP |
Stop
execution of the script |
|
ip(123.456.789.0): |
Label
for GOTO statement. |
|
ip(321.321.321.1): |
Label
for GOTO statement |
|
HOSTNAME
#ip_addr# |
Set
the host’s IP address to whatever the user chose, as long as it was
123.456.789.0 or 321.321.321.1 |
|
CONNECT |
Connect
to the remote computer |
Sets whether to translate and draw graphics characters (e.g. boxes around text etc.)
|
GRAPHICS {TRUE | ON | ENABLED | OTHER} Enable Graphic Characters using one of TRUE, ON, or ENABLED. Disable Graphic Characters using anything else – e.g. FALSE, OFF, or DISABLED. |
|
HOSTNAME name where name is the name of the computer to log on to. |
This identifies the remote computer that you wish to log onto.
This is stored in the system registry, which means that it will be available next time you start ArcTel.
If you wish to clear the host name after disconnecting, just use the command HOSTNAME with a space after it, which will make the hostname blank next time ArcTel is started.
If you have DNS services available, this can be in the form of (for example) telnet.myorg.co.uk or alternatively, in the form of an IP address –e.g. 120.130.140.1
|
IF “condition1” [NUM ]operator “condition2” [{ELSIF | ELSEIF | ELSE-IF} “condition1” [NUM ]operator “condition2”] ... [ELSE | OTHERWISE] ... [ENDIF | END IF | END-IF | FI] Operator
is defined as one of:- =|==|EQ|<>|!=|NE|<=|LE|>=|GE|<|LT|>|GT|%|CONTAINS|CT|IN|
!%|NOT IN|NI|NC|NOT CONTAINING|<<|STARTS|STARTING|
BEGINS|BEGINNING|!<|NOT STARTING|NOT BEGINNING| NS|>>|FINISHES|FN|ENDS|!>NOT ENDING|NE where condition1 and condition2 are matched using one of the operators, and the commands between IF and ENDIF denotes by …s are only executed if these are matched OK.
|
If you prefix an operator with the word NUM then the two conditions will be treated as numbers instead of strings for the purposes of comparison.
Note that only the =, <>, <, >, <= and >= operators and their equivalents can treat the conditions as numeric. Any other operator defaults to comparing the conditions as strings.
This command is used to execute a block of instructions (between the IF statement and the ENDIF statement) based on whether a simple comparison is true.
For example, IF “HELL” IN “HELLO” would yield true, but IF “12”<”09” would yield false.
In general, you would use this in conjunction with the available macro substitution codes.
The comparison is not case-sensitive, so you can compare “HeLlO” and “HELLO” as if they were the same.
However, you can have further alternative conditions using any number of ELSIF commands within the IF and ENDIF block. To specify a final default alternative condition - ie. instructions that should be executed if none of the IF or ELSIF conditions have been satisfied, use the ELSE command.
The available conditions are described below:
|
Condition /
Variation(s) |
Description |
Example (each
is TRUE) |
|
= == EQ |
Equals |
IF “ABC”==”abc” |
|
<> != NE |
Not Equal To |
IF “ABC”<>”CBA” |
|
<= LE |
Less than or equal to |
IF “ABC”<=”ABD” |
|
>= GE |
Greater than or equal to |
IF “ABC” >=”ABC” |
|
< LT |
Less than |
IF “ABC”<”CCC” |
|
> GT |
Greater than |
IF “ABC”>”ABB” |
|
%
CONTAINS CT |
Contains |
IF “HELLO” CONTAINS “EL” |
|
IN |
In |
IF “EL” IN “HELLO” |
|
!%
NC |
Does not contain |
IF “HELLO” NC “ELP” |
|
NOT IN NI |
Is not inside |
IF “ELP” NOT IN “HELLO” |
|
<< STARTS ST STARTING BEGINS BEGINNING |
Starts with |
IF “HELLO” STARTS “HE” |
|
!< NOT STARTING NOT BEGINNING NS |
Does not start with |
IF “HELLO” NS “HELP” |
|
>> FINISHES FN ENDS |
Finishes with |
IF “HELLO” ENDS “LO” |
|
!> NOT ENDING NE |
Does not finish with |
IF “HELLO” NE “LOP” |
|
IF “#CLIPBOARD#” STARTS “LOGIN” |
Clipboard text starts with LOGIN? |
|
connect |
If
so, Connect to the currently defined session |
|
stop |
Stop
execution of the script |
|
ELSIF “#CLIPBOARD#” CONTAINS “LOGOUT” |
Otherwise, if Clipboard
text contains “LOGOUT” |
|
Disconnect |
If
so, disconnect from the current session |
|
Stop |
Stop
execution of the script |
|
Else |
Otherwise, if not login or logout --- |
|
Message
Clipboard contains neither LOGIN nor LOGOUT |
Show
message saying neither LOGIN nor LOGOUT selected. |
|
ENDIF |
End
of condition block |
|
INC var_name INCREMENT var_name where var_name is the name of an existing variable which contains a numeric value. |
For many purposes, you may want to increment a numeric value stored in a variable during a process, for example if you are emulating a loop. Use this command to achieve this purpose.
The example below shows a message box for numbers 1 through to 5 in a loop, then quits the loop.
|
SET loopvar=1 |
Set loop variable |
|
loopstart: |
Start of loop |
|
MESSAGE Loopvar is #loopvar# |
Display ‘Loopvar
is 1’, etc. |
|
INC loopvar |
Increment loopvar
– add 1 to its value |
|
IF “#loopvar#” NUM <= “5” |
If loop variable is numerically less than or equal
to 5 … |
|
GOTO loopstart |
… then go back to loopstart for the next
iteration |
|
ENDIF |
End of If condition block |
|
MESSAGE end of loop |
Display End of loop in a message box. |
|
LINE HEIGHT line_height where line_height is the height of line in terms of number of pixels, and is a whole number. |
If you increase the size of the font, it will also be necessary to increase the size of the line height, otherwise the font will be cut off in height
You can also use this option to increase the spacing between lines of text to make them more readable.
|
LINE ZOOM zoom_amount[%] where zoom_amount is the amount to zoom the spacing by (where 1 is no zoom). To make this a percentage value, add a % symbol (no zoom then being 100%) |
If you find the characters are not deep enough, making the screen look squashed, then you may like to increase the line zoom – e.g. 2 or 200% (for 200%) would make the characters twice as deep/high, and 0.5 or 50% (for 50%) would make them twice as shallow / half as high. See also LINE WIDTH.
Manipulate (add to, delete from, merge into, load or save) standard list of strings
|
EMAIL LIST commands [string] where commands is a set of command to act on the string - e.g. ADD etc. |
Use this command to use the standard list for creating a list of strings, saving to and loading from it etc. You can use the PRINT LIST command to print the contents of the standard list.
Note that you can use a single line of text, or a list of text lines separated by semi-colons. It is also possible to add to, merge into, delete from, load and save this list using the standard list-building facilities of Arctel, explained here.
|
LOAD LOG |
If no filename has been previously specified (e.g. using the LOG NAME command), a dialog box is displayed for the user to select a log to load from.
You can also use this command to revert to the previously saved version of the current log file.
|
LOG ERRORS ON |
Log any errors |
|
LOG
SCREEN ON |
Log
anything that is transmitted/received during the session |
|
LOG
COMMANDS OFF |
Do
not log commands that are run in the script |
|
LOG
NAME c:\windows\std_telnet_log.alf |
Log
will be saved to file c:\windows\std_telnet_log.alf |
|
DEFAULT
LOG |
Log
c:\windows\std_telnet_log.alf is
the default log, which will automatically be loaded when ArcTel starts up. |
|
LOAD
LOG |
Load
the existing log from disk |
|
LOG
ENABLED |
Turn
logging on |
Load, but don’t execute a script from a file. Replace the current script.
|
LOAD SCRIPT scriptfilename where scriptfilename is the name of the script file to load into memory |
Use the command to terminate the current script and load into memory another script, loaded in from a specified file.
The current script is not stored so that execution can return to the script after the called script has finished. Instead, the loaded script replaces the current script.
Effectively, this terminates execution once the script is loaded.
|
LOCAL ECHO {TRUE | ON | ENABLED | OTHER} Enable using one of TRUE, ON, or ENABLED. Disable using anything else – e.g. FALSE, OFF, or DISABLED. |
Some terminals do not send back the user’s keyboard input, and rely on the local terminal emulator to do this. If you are finding that the text you type is never appearing on the screen, enable this option.
|
LOG {TRUE | ON | ENABLED | OTHER} Enable using one of TRUE, ON, or ENABLED. Disable using anything else – e.g. FALSE, OFF, or DISABLED. |
This will turn logging on or off.
This overrides logging of commands / errors / terminal activity.
Thus you need to use this option in order for logging to work at all. The only exception is if you use the LOG LINE command to explicitly add a specific line of text to the log.
Nb. This setting is retained even after closing the ArcTel program, so will remain active when you next execute the ArcTel program.
|
LOG APPEND {TRUE | ON | ENABLED | OTHER} Enable using one of TRUE, ON, or ENABLED. Disable using anything else – e.g. FALSE, OFF, or DISABLED. |
This will turn appending of the log between sessions on or off.
When append logging is enabled, the default log will be opened when the ArcTel program is started, and any further logging will be added to the end of this log. If it is disabled, then logging will start anew each time the ArcTel program is started.
As the log is saved automatically when the user exits ArcTel, the effect of this is to either keep the log going ad-infinitum if this option is enabled, or only contain details from the last session if the option is disabled.
Nb. This setting is retained even after closing the ArcTel program, so will remain active when you next execute the ArcTel program.
|
LOG COMMANDS {TRUE | ON | ENABLED | OTHER} Enable using one of TRUE, ON, or ENABLED. Disable using anything else – e.g. FALSE, OFF, or DISABLED. |
This will turn logging of script lines on or off.
When logging of commands is enabled, a script line is added to the log just prior to it being executed, prefixed with the text: <COMMAND> Line lineno: where lineno is the line number of the line from the start of the script.
This command is useful if you want to trace the flow of execution within the script whilst debugging.
Nb. This setting is retained even after closing the ArcTel program, so will remain active when you next execute the ArcTel program.
|
LOG ERRORS {TRUE | ON | ENABLED | OTHER} Enable using one of TRUE, ON, or ENABLED. Disable using anything else – e.g. FALSE, OFF, or DISABLED. |
This will turn logging of errors on or off.
When logging of errors is enabled, any errors encountered will be logged with the line number they occurred on in the log file.
Nb. This setting is retained even after closing the ArcTel program, so will remain active when you next execute the ArcTel program.
Adds a line of text to the log
|
LOG LINE text Where text is the text to add to the log. |
This command is useful for placing flags at key points in a script in order to log ‘milestones’ in the script’s execution.
Set the filename for the log file, to which telnet activity will be saved.
|
LOG NAME [=] logfilename where logfilename is the file name and path that the log will be saved to using the SAVE LOG command. |
Alternatively, if you wish to load and use a specific log, use this command
followed by the LOAD LOG command.
|
LOG ERRORS ON |
Log any errors |
|
LOG
SCREEN ON |
Log
anything that is transmitted/received during the session |
|
LOG
COMMANDS OFF |
Do
not log commands that are run in the script |
|
LOG
NAME c:\windows\std_telnet_log.alf |
Log
will be saved to file c:\windows\std_telnet_log.alf |
|
DEFAULT
LOG |
Log
c:\windows\std_telnet_log.alf is
the default log, which will automatically be loaded when ArcTel starts up. |
|
CLEAR
LOG |
Clear
the log of its contents |
|
SAVE
LOG |
Save
the log to the filename c:\windows\std_telnet_log.alf |
|
LOG
ENABLED |
Turn
logging on |
|
LOG SCREEN {TRUE | ON | ENABLED | OTHER} Enable using one of TRUE, ON, or ENABLED. Disable using anything else – e.g. FALSE, OFF, or DISABLED. |
This includes any special Telnet-related codes (see Appendix VI for further information). Nb. Any special characters (e.g. ASCII below 32) are displayed as the hexadecimal equivalent, enclosed in chevrons (<>).
Nb. This setting is retained even after closing the ArcTel program, so will remain active when you next execute the ArcTel program.
|
LOWER varname where varname is the name of the variable whose contents you wish to make lower case. |
|
SET
input_text=#PROMPT Enter something# |
Prompts
user to enter something, and store the result in variable called input_text |
|
COPY
#Input_text#,1,1 TO first_letter |
Copy
first letter of input text to variable called first_letter |
|
COPY
#input_text#,2,1000 TO rest_string |
Copy
rest of string to variable called rest_string
up to a maximum length of 1000 characters |
|
UPPER
first_letter |
Make
first letter upper case |
|
LOWER
rest_string |
Make
rest of text lower case |
|
MESSAGE
#first_letter##rest_string# |
Display
first_letter and rest_text
together. |
|
LPAD var_name,max_length,pad_char where var_name is the name of the variable you wish to pad and max_length is the length the string should be after the LPAD command and pad_char is the character which you wish to pad the variable with. |
Use this command to force a string to a given length by inserting characters to the left of the existing string. This is useful when you wish to produce text which aligns correctly.
In the below example, a string is input by the user and
padded to the left to a 5 character width with leading 0s:-
|
SET
input_text=#PROMPT Enter number# |
Prompts
user to enter something, and store the result in variable called input_text |
|
LPAD
input_text,5,0 |
Pads
the text to a length of 5 characters with leadings 0’s |
|
MESSAGE
Value is ‘#input_text#’ |
Display
the padded result. |
|
MAX[IMIZE] |
Display a message in a dialog box.
|
MESSAGE message_text MSG message_text where message_text is the text to be displayed in the dialog box. |
Use this to display a message in a dialog box. Useful for notifying a user of an event.
|
MESSAGE
You typed ‘#PROMPT Enter something#’. |
Prompts
user to enter something, and then displays a message telling the user what
was typed. |
|
MIN[IMIZE] |
Use any word starting with MIN (e.g. MAX or MINIMIZE or MINIMISE) to minimize the ArcTel window – i.e. make it disappear from the scren, and only display in the Windows task bar. This is useful where you are calling Telnet to run a process which you wish to be invisible to the user.
|
OEM CHARSET {TRUE | ON | ENABLED |
OTHER} Enable using one of TRUE, ON, or ENABLED. Disable using anything else – e.g. FALSE, OFF, or DISABLED. |
This will only affect non-standard characters (from 80H upwards) – i.e. those using ASCII codes above the standard range of ASCII characters.
Pause for a specified period of time before executing the next script line.
|
PAUSE time_secs where time_secs is the time to wait, in seconds. |
Use this to pause execution for a given period of time before continuing on to the next script line.
Can specify up to 1/1000s of a second accuracy – e.g. 0.001 is smallest time possible to pause.
This function is useful if you wish to wait a specified period of time for the terminal session to complete a given task.
Port of Computer to use.
|
PORT port where port is the port on which the telnet service is available. |
The computer that you are logging into uses different ports for different processes. If you wish to use the default telnet, port, set port to telnet otherwise, set port to the number of the port from which the telnet service is available.
Print the contents of a file immediately to a printer as a formatted report.
|
PRINT FILE
[title;]filename where title is the title to display at the top of the page and filename is the name of the text file whose contents you wish to print. |
This command will print the contents of a text file specified by a given filename to the default printer. The default title is taken from the filename of the script currently being run, if you do not specify one.
The report is printed with page numbers and headers.
Print the contents of the standard list immediately to the printer as a formatted report.
|
PRINT LIST [title] where title is the title to display at the top of the page |
This command will print the contents of the standard list (generated using the LIST command) to the default printer. The default title is taken from the filename of the script currently being run, if you do not specify one. See the script-writing section for more details on generating lists.
The report is printed with page numbers and headers.
Exit from the ArcTel program completely. Disconnects from the open session first, if applicable.
|
QUIT EXIT SYSTEM BYE |
Use any one of these commands to quit the ArcTel program from within a script.
If you are automating a process using a script, then you may wish to start ArcTel, run the appropriate script, and then exit from ArcTel automatically.
|
REFRESH
SCREEN |
Use this option if you have AUTO REFRESH disabled, and you only wish to update a number of changes to terminal settings in one go. This will save unnecessary reprocessing of the screen.
Remark line for documenting the operation of a script.
|
REM remark -- remark // remark ' remark where remark is any text for the purposes of documenting the script. |
Use any of these three forms to specify some descriptive
text to document the operation of the script. The computer will not perform any
action on these lines, with the exception of a line ending with a
colon (:) which could potentially be treated as a label for a GOTO
statement.
|
rem
Log will be saved to file c:\windows\std_telnet_log.alf |
|
LOG
NAME c:\windows\std_telnet_log.alf |
|
--
Save the log to the filename c:\windows\std_telnet_log.alf |
|
SAVE
LOG |
Return from a script called by the CALL SCRIPT command.
| RETURN
FROM SCRIPT
SCRIPT RETURN |
This closes the current (called) script, and returns execution to the calling script.
It is possible to run other scripts from within a script, and when finished with that script, return control to the original script. This is a little like procedure calling in many programming languages.
Calls to scripts may be nested – there is no fixed limit to the depth of nesting. Be careful that you do not accidentally call a calling script from a called script, unless you have a specific exit condition to prevent two scripts infinitely calling each other.
| ROWS num_rows where num_rows is the number of lines of text that may be displayed on the terminal screen. |
This is generally set at 24 or 25 lines of text. Only increase / decrease it if you seem to miss lines of data or have too many blank lines at the bottom of the screen.
Note the bottom of the terminal display is denotes by a horizontal line. Max no. of rows is 50.
Load and execute a script from a file, replacing the
current script.
|
RUN scriptfilename EXEC scriptfilename EXECUTE scriptfilename where scriptfilename is the name of the script file to execute |
Use the command to terminate the current script and start execution of another script, loaded in from a specified file.
Note that this differs from the CALL SCRIPT function in that the current script is not stored so that execution can return to the script after the called script has finished. Instead, the loaded script replaces the current script.
Thus, if you call a script using CALL SCRIPT, and then from that script, execute another script using RUN or EXEC or EXECUTE, then you can still use SCRIPT RETURN to return to the original calling script.
Example of Calling Script,
EXECUTING script, then returning to original script.
|
|||
Step 2 Step 3 Step 4
![]()

|
SAVE LOG |
If no filename has been previously specified (e.g. using
the LOG NAME command), a dialog box
is displayed for the user to select a log to save to.
|
LOG ERRORS ON |
Log any errors |
|
LOG
SCREEN ON |
Log
anything that is transmitted/received during the session |
|
LOG
COMMANDS OFF |
Do
not log commands that are run in the script |
|
LOG
NAME c:\windows\std_telnet_log.alf |
Log
will be saved to file c:\windows\std_telnet_log.alf |
|
DEFAULT
LOG |
Log
c:\windows\std_telnet_log.alf is
the default log, which will automatically be loaded when ArcTel starts up. |
|
CLEAR
LOG |
Clear
the log of its contents |
|
SAVE
LOG |
Save
the log to the filename c:\windows\std_telnet_log.alf |
|
LOG
ENABLED |
Turn
logging on |
Change the height of the ArcTel window.
| SCREEN HEIGHT height where height is the height of the ArcTel window in pixels. |
As part of your session setup, you may wish to show the screen as a particular height, to just fit in the height of the terminal given the settings you have chosen, for example. Use this command to achieve this.
| SCREEN WIDTH width where width is the width of the ArcTel window in pixels. |
Change the height of the Script box.
| SCRIPT HEIGHT height where height is the height of the ArcTel Script box in pixels. |
As part of your session setup, you may wish to set the size of the script edit box. Increasing the size of the script box will decrease the size of the terminal box and vice versa.
To hide the script box, but still keep it available using the drag-bar, set height to 0.
| SCRIPT NAME [=] scriptfilename where scriptfilename is the file name and path where the script should be stored |
This command only changes the script filename. It does not save the contents of the script to the file immediately. This only happens either when the ArcTel program is closed, or when the user selects the Script | Save menu option.
Hide or show the script box.
|
SCRIPT VISIBLE {TRUE | ON |
ENABLED | OTHER} Enable using one of TRUE, ON, or ENABLED. Disable using anything else – e.g. FALSE, OFF, or DISABLED. |
As part of your session setup, you may wish to hide the script edit box, so the user cannot see the contents of the script that is running. To hide the script box, so that it is unavailable even using the drag-bar, enable this command.
Send data to the remote terminal.
|
SEND text where text is the text to be sent to the remote terminal. |
For Carriage returns, tab stops etc. within the text
string, use macro substitution – e.g. #13##10# for ASCII code 13 followed by
ASCII code 10, which is equivalent to a Carriage Return / Line Feed (or the user
press the Enter key). See Appendix II
regarding macro substitution.
|
CLEAR
TRIGGERS |
Ensure
there are no outstanding triggers in memory |
|
HOSTNAME
123.456.789.0 |
Set
remote computer as having IP address of 123.456.789.0 |
|
TRIGGER
1,login,USER1#13##10# |
When
the terminal displays login,
send the text USER1 followed by a carriage return. |
|
CONNECT |
Connect
to computer 123.456.789.0 |
Set the bounding rectangle for selected text on the terminal.
|
SET [TOP [=] top_pos [,LEFT [=] left_pos] [,BOTTOM [=] bot_pos] [,RIGHT [=] rt_pos] where top_pos is the pixel row of the top side of the bounding rectangle, and left_pos is the pixel column of the left side of the bounding rectangle, and bot_pos is the pixel row of the bottom side of the bounding rectangle, abd rt_pos is the pixel column of the right side of the bounding rectangle. |
Use the SELECTION command when you want to place a selection box around a particular region of the terminal screen. You can use the COPY SELECTION command to copy the text within this region to the clipboard, and then refer to the contents of the box using the #clipboard# macro substitution.
This could be useful when you wish to test to see whether a particular area of the screen contains the text you expect.
When writing the program, draw the rectangle where you would like it to be in the program, and use the option from the Script/Insert menu to insert a Selection Rectangle Command into the script.
In the following example, the program will display “Found” if the word “INSERT” is found on line 25 towards the right hand side of the screen.
|
Selection TOP=280, BOTTOM=296, LEFT=510, RIGHT=558 |
Select
a rectangle one line deep on line 25, about 2/3 across. |
|
Copy Selection |
Copy
the contents of the selection rectangle. |
|
if "#clipboard#" contains
"INSERT" |
if
the contents contain the word INSERT… |
|
message Found |
…
show the Found message. |
|
endif |
end
of if block. |
|
SET varname=valuetext where varname is the name of the user-defined variable to use. nb. it is legal to use system-defined keywords as user-variables, but this may not be supported in future versions. and valuetext is the value to assign to the variable |
Variables currently have limited functionality. They can
only be used as macro substitutions (e.g. if you place #varname# into your script, it will be substituted with a value of varname
when the line is executed).
|
SET
host_name=#PROMPT What is the host?,123.456.789.0# |
Prompt
the user for a host name, default of 123.456.789.0 Set
variable host_name to be the
result of user’s input. |
|
HOSTNAME
#host_name# |
Set
remote computer as having IP address contained within host_name variable, as input by the user in above command. |
|
CONNECT |
Connect
to remote computer |
|
SHELL [MIN|MAX] app_path where app_path is the filename and path locating the application / batch file to execute. |
This executes a specified application and returns control immediately to the calling script.
If no directory path is specified, the following directories are searched, in this order:
The directory from which the application loaded
The current directory
The Windows system directory
The Windows directory
The directories listed in the PATH environment variable
The SHELL option is useful if you want to carry out further processing beyond the scope of the script commands used in ArcTel.
Set the standard keyboard definition according to terminal type.
|
STD KEYS {SCO|VT100|A11} STANDARD KEYS {SCO|VT100|A11} |
Different terminal types are set up to respond to different keystrokes. Ie. The keyboard (including function keys) is set up to respond in a particular way according to the terminal type.
Define the keyboard layout using one of these options – e.g. STD KEYS VT100.
Halts execution of the script at the current line.
| STOP |
This halts execution of the script at the current line. If a trigger has been activated, it may restart execution at another point in the script, even after a STOP command has been executed. This makes it ideal to use after defining a trigger, where you want to wait until a specified piece of text activates the trigger and [optionally] recommences execution.
Create a new trigger.
| TRIGGER
[STOP|WAIT] [IGNORE CASE
{TRUE|ON|OTHER}] [{KEEP | PERSISTENT} {TRUE|ON|OTHER}] trigger_no,search_text,send_text,[goto_label] Include STOP or WAIT to stop execution of the program immediately, and continue execution only when the trigger is activated. Include IGNORE CASE followed by TRUE or ON to ignore the case of the text to Match – e.g. if search_text is login then login, LOGIN, Login, or LogIn would all activate the trigger if IGNORE CASE is TRUE or ON. Use OFF or FALSE or some other descriptive negative text to only allow an exact match (in the above example, only login would activate the trigger). Include KEEP or PERSISTENT
followed by TRUE or ON to keep the trigger in memory so that it can be
triggered again after the initial trigger. Alternatively, use OFF or FALSE or
some other descriptive negative text if you wish the trigger to activate once
only, and then be removed from memory.
|
Triggers identify an action to take when a particular
sequence of characters is displayed on the terminal. For example, to automate a
login sequence, you may set up a trigger on the word ‘login’ which then
automatically sends the login name to the terminal, and then jumps to a part of
the script which generates a new trigger on the word ‘password’ etc. etc.
Below is an example of this:-
|
CLEAR
TRIGGERS |
Ensure
there are no outstanding triggers in memory |
|
HOSTNAME
123.456.789.0 |
Set
remote computer as having IP address of 123.456.789.0 |
|
TRIGGER
1,login,USER1#13##10#,login |
When
the terminal displays login,
send the text USER1 followed by a carriage return, and start the script at
the line marked login: |
|
CONNECT |
Connect
to computer 123.456.789.0 |
|
STOP |
Terminate
the script. The script will be restarted at the line marked login:
when the terminal displays the text login |
|
login: |
Start
here when TRIGGER #1 (text login)
is activated |
|
TRIGGER
WAIT
2,password:,#DECRYPT 3OQ*N&P##13##10#,password |
Second
trigger: When the text password:
is encountered, output the password followed by a carriage return, and go
to line labelled password: in
script. Stop the program until this time. |
|
password: |
Start
here when TRIGGER #2 (text password)
is activated. |
|
TRIGGER
WAIT
3,Select Environment,p#13##10#,production |
Third
trigger. When the text Select
Environment is encountered, send a p
for production followed by a carriage return, and then start the script at
the label production: |
|
production: |
Start
here when TRIGGER #3 (text Salect
Environment) is activated. |
|
SEND
ls –alrt >dir.txt#13##10# |
Run
the ls-alrt >dir.txt command
within the host computer’s environment. In this example, this puts a
directory listing of the current directory into a file dir.txt in the same directory on this host computer. |
|
SEND
exit#13##10# |
Tell
the host computer to exit and therefore terminate the connection |
|
WAIT
3 |
Wait
for three seconds to make sure everything has terminated OK. |
|
CLEAR
TRIGGERS |
Clear
triggers to make sure not triggered by accident at any other time. |
Deletes a specified trigger
| TRIGGER DELETE trigger_no |
This will remove a specific trigger from memory.
It is worth removing triggers after use, in case the trigger text is inadvertently displayed later in the terminal session – e.g. if login was your trigger text, and later you edit a document with the word ‘login’ in it, this would activate the trigger with potentially unpredictable results.
You can also remove all triggers after use by using the CLEAR TRIGGERS command.
| TRIM varname |
For comparison or display purposes, it is often useful to remove any extraneous spaces or other control characters from the start and end of a piece of text. Use this command for this purpose.
| TYPING {TRUE | ON | ENABLED | OTHER} Enable using one of TRUE, ON, or ENABLED. Disable using anything else – e.g. FALSE, OFF, or DISABLED. |
Changes the lower case letters in a variable to upper case, so variable contains only upper-case letters.
| UPPER varname where varname is the name of
the variable whose contents you wish to make upper case. |
It is often useful to ‘normalise’ a string, for example
for string comparison purposes. For example, if you had an input string which
was one of “Yes”, “YES”, and “yes”, then this command would change
it to “YES” which is much easier to compare. It can also be used to make
text more prominent. Also, some terminals expect text to be in UPPER CASE
The example below prompts the user for some text, and converts it into lower case, with a capital letter for the first letter of the sentence:-
|
SET
input_text=#PROMPT Enter something# |
Prompts
user to enter something, and store the result in variable called input_text |
|
COPY
#Input_text#,1,1 TO first_letter |
Copy
first letter of input text to variable called first_letter |
|
COPY
#input_text#,2,1000 TO rest_string |
Copy
rest of string to variable called rest_string
up to a maximum length of 1000 characters |
|
UPPER
first_letter |
Make
first letter upper case |
|
LOWER
rest_string |
Make
rest of text lower case |
|
MESSAGE
#first_letter##rest_string# |
Display
first_letter and rest_text
together. |
| UPPER LOCK {TRUE | ON | ENABLED | OTHER} Enable using one of TRUE, ON, or ENABLED. Disable using anything else – e.g. FALSE, OFF, or DISABLED. |
If you wish to ensure that anything input by keyboard is in
CAPITAL LETTERS, use this option. Certain terminals only recognize upper case,
and some applications assume the use of input in capitals, thus it would be
useful to enable this option in these cases.
(c)
Copyright 2001-2 Arctan Computer Ventures Ltd. All Rights Reserved.
If you have any issues regarding this on-line help, please contact the
author by clicking here.
Alternatively, you can leave a voice message on 00 44 (0)7050-618-297 or fax
on 00 44 (0)7050-618-298
This Page was last updated: 15 January 2004 15:01