home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1997 July / VPR9707A.ISO / OLS / Win32 / TTERMP20 / TTMACRO.TXT < prev    next >
Text File  |  1996-06-07  |  38KB  |  1,450 lines

  1.     TTMACRO for Tera Term
  2.     T. Teranishi
  3.  
  4.     Copyright (C) 1994-1996 T. Teranishi
  5.     All Rights Reserved.
  6.  
  7. -------------------------------------------------------------------------------
  8. INDEX
  9.  
  10. 1. Introduction
  11.  
  12. 2. Installation
  13.  
  14. 3. How to run a macro file
  15.  
  16. 4. Macro language "Tera Term Language (TTL)"
  17.  
  18.   4.1 Types
  19.   4.2 Formats of constants
  20.   4.3 Identifiers and reserved words
  21.   4.4 Variables
  22.   4.5 Expressions and operators
  23.   4.6 Line formats
  24.  
  25. 5. TTL command reference
  26.  
  27.   5.1 Communication commands
  28.   5.2 Control commands
  29.   5.3 String operation commands
  30.   5.4 File operation commands
  31.   5.5 Miscellaneous commands
  32.  
  33. 6. Appendixes
  34.  
  35.   Appendix A    Error messages
  36.   Appendix B    About new-line characters
  37.  
  38. -------------------------------------------------------------------------------
  39. 1. Introduction
  40.  
  41. TTMACRO is an interpreter of the macro language 'Tera Term Language (TTL)',
  42. which controls Tera Term and provides various functions like auto dialing,
  43. auto login, and so on.
  44.  
  45. Note that TTMACRO.EXE is a 16-bit executable file. Long macro filenames
  46. are not supported.
  47. -------------------------------------------------------------------------------
  48. 2. Installation
  49.  
  50. Place TTMACRO.EXE in the directory (folder), in which Tera Term
  51. is installed.
  52.  
  53. -------------------------------------------------------------------------------
  54. 3. How to run a macro file
  55.  
  56. There are two ways to run a macro file.
  57.  
  58. 1) From Tera Term.
  59.  
  60. To start TTMACRO, select the [Control] Macro command and then the macro file in
  61. the Open Macro dialog box.
  62.  
  63. 2) From TTMACRO.
  64.  
  65. The macro file can be specified as a parameter in the command line (shortcut
  66. link) of TTMACRO. For example, if you want to run the macro file "DIALUP.TTL",
  67. specify the command line (shortcut link) like:
  68.  
  69.     TTMACRO DIALUP.TTL
  70.  
  71. You can omit the file name extension ".TTL". If you omit the file name, the
  72. Open Macro dialog box appears. It's convenient to install icons (shortcuts)
  73. for the macro files you use frequently.
  74.  
  75. If you choose method 2), you can run Tera Term, after starting the TTMACRO,
  76. by using the "connect" command in the macro file. See the description of the
  77. "connect" command in section 5.1.5.
  78.  
  79. While the macro is running, you can pause it, restart it, and stop it by
  80. pressing the appropriate buttons in the TTMACRO dialog box.
  81.  
  82. -------------------------------------------------------------------------------
  83. 4. Macro language "Tera Term Language (TTL)"
  84.  
  85. TTL is a simple interpreted language like BASIC. To learn TTL quickly, study
  86. the sample macro files in the distribution package and the command reference
  87. in section 5.
  88.  
  89. ...............................................................................
  90. 4.1 Types
  91.  
  92. TTL have two kinds of data types:
  93.  
  94.     Integer
  95.         Signed 16 bit, from -32768 to 32767.
  96.  
  97.     Character string
  98.         A sequence containing any character except NUL.
  99.         The maximum length of a string is 255.
  100.  
  101. ...............................................................................
  102. 4.2 Formats of constants
  103.  
  104. 1) Integer-type constants
  105.  
  106.     Expressed as a decimal number.
  107.  
  108.     Example:
  109.         123
  110.         -11
  111.  
  112. 2) String-type constants
  113.  
  114.     There are two ways of expressing string-type constants.
  115.  
  116.     a) A character string quoted by ' or " (both sides must be same).
  117.  
  118.     Example:
  119.         'Hello, world'
  120.         "I can't do that"
  121.  
  122.     b) A single character expressed as a "#" followed by an ASCII code
  123.     (decimal number).
  124.         Note:    Strings can not contain NUL (ASCII code 0) characters.
  125.  
  126.     Example:
  127.         #65        the character "A"
  128.         #13        the CR character
  129.  
  130.     Format a) and b) can be combined in an expression.
  131.  
  132.     Example:
  133.         'cat readme.txt'#13#10
  134.         'abc'#13#10'def'#13#10'ghi'
  135.  
  136. ...............................................................................
  137. 4.3 Identifiers and reserved words
  138.  
  139. 1) Variable identifiers
  140.  
  141. The first character must be an alphabetic (A-Z, a-z) or an underscore
  142. character "_". Subsequent characters can be alphabetic, underscore, or numeric
  143. (0-9). Variable identifiers are not case sensitive. The maximum length is 32.
  144.  
  145.     Example:
  146.         VARIABLE
  147.         _flag
  148.  
  149. 2) Label identifiers
  150.  
  151. Label identifiers consist of alphabetic, underscore, or numeric characters,
  152. and are not case sensitive. The maximum length is 32.
  153.  
  154.     Example:
  155.         label1
  156.         100
  157.  
  158. 3) Reserved words
  159.  
  160. The following words are reserved:
  161.  
  162. [Command]
  163.     beep, bplusrecv, bplussend... (see the list in section 5.)
  164.  
  165. [Operator]
  166.     and, not, or, xor
  167.  
  168. [System variables]
  169.     inputstr, param2, param3, result, timeout
  170.  
  171. ...............................................................................
  172. 4.4 Variables
  173.  
  174. 1) User variables
  175.  
  176. Defined by user. The type of a variable is determined when a value
  177. (integer or string) is assigned to it for first time. Once the type of
  178. the variable is determined, values of a different type can not be
  179. assigned to it.
  180.  
  181. 2) System variables
  182.  
  183. Variables which have a predefined type and value. Used with particular
  184. commands.
  185.  
  186. Variables    Type    Initial value    Related commands
  187. ------------------------------------------------------------------------
  188. inputstr    string        ''    inputbox, passwordbox
  189. param2        string        *1    *1
  190. param3        string        *1    *1
  191. result        integer        0    filereadln, filesearch, filestrseek,
  192.                     str2int, strcompare, strlen, strscan,
  193.                     wait, waitrecv, yesnobox
  194. timeout        integer        0    wait, waitrecv
  195.  
  196.     *1 Second and third command line parameter of TTMACRO. The first
  197.     parameter is the macro file name.
  198.  
  199. ...............................................................................
  200. 4.5 Expressions and operators
  201.  
  202. Expressions consist of constants, variables, operators, and parentheses.
  203. Constants and variables must be of the integer type. The value of an
  204. expression is also an integer. The values of a relational expression
  205. (formed using relational operators) are 0, if it is true, or 1 if false.
  206.  
  207. The following are operators:
  208.  
  209. Category    Precedence    Operators
  210. --------------------------------------------------------------
  211. unary        1, high        not
  212. multiplicative    2        *, /
  213. additive    3        +, -, or, xor
  214. relational    4, low        =, <>, <, >, <=, >=
  215.  
  216. ...............................................................................
  217. 4.6 Line formats
  218.  
  219. There are five kinds of line formats in the macro files.
  220.  
  221. 1) Empty lines
  222.  
  223. Lines which have no character or contain only space and tab characters.
  224. They have no effect on the execution of the macro.
  225.  
  226. 2) Comment lines
  227.  
  228. Lines beginning with a ';' character. No effect on the execution of the macro.
  229.  
  230.     Example:
  231.         ; Tera Term Language
  232.  
  233. 3) Command lines
  234.  
  235. Lines containing a single command with parameters (the one exception is the
  236. "if" command (see 5.2.7)).
  237.  
  238.     Format:
  239.         <command> <parameter> ...
  240.     Example:
  241.         connect'myhost'
  242.         wait 'OK' 'ERROR'
  243.         if result=2 goto error
  244.         sendln 'cat'
  245.         pause A*10
  246.         end
  247.  
  248. 4) Assignment lines
  249.  
  250. Lines which contain an assignment statement.
  251.  
  252.     Format:
  253.         <Variable> = <Value (constant, variable, expression)>
  254.     Example:
  255.         A = 33
  256.         B = C        C must already have a value.
  257.         VAL = I*(I+1)
  258.         A=B=C        the value of B=C (0 for false, 1 for true) is
  259.                 assigned to A.
  260.         Error=0<J
  261.         Username='MYNAME'
  262.  
  263. 5) Label lines
  264.  
  265. Lines which begin with a ':' character followed by a label identifier.
  266.  
  267.     Format:
  268.         :<Label>
  269.     Example:
  270.         :dial
  271.         :100
  272.  
  273. -------------------------------------------------------------------------------
  274. 5. TTL command reference
  275.  
  276. Command index
  277.  
  278. 5.1 Communication commands
  279.  
  280.     5.1.1 bplusrecv
  281.     5.1.2 bplussend
  282.     5.1.3 changedir
  283.     5.1.4 closett
  284.     5.1.5 connect
  285.     5.1.6 kmtrecv
  286.     5.1.7 kmtsend
  287.     5.1.8 logclose
  288.     5.1.9 logopen
  289.     5.1.10 logpause
  290.     5.1.11 logstart
  291.     5.1.12 logwrite
  292.     5.1.13 quickvanrecv
  293.     5.1.14 quickvansend
  294.     5.1.15 send
  295.     5.1.16 sendfile
  296.     5.1.17 sendln
  297.     5.1.18 showtt
  298.     5.1.19 wait
  299.     5.1.20 waitrecv
  300.     5.1.21 xmodemrecv
  301.     5.1.22 xmodemsend
  302.     5.1.23 zmodemrecv
  303.     5.1.24 zmodemsend
  304.  
  305. 5.2 Control commands
  306.  
  307.     5.2.1 call
  308.     5.2.2 end
  309.     5.2.3 execcmnd
  310.     5.2.4 exit
  311.     5.2.5 for, next
  312.     5.2.6 goto
  313.     5.2.7 if, then, elseif, else, endif
  314.     5.2.8 include
  315.     5.2.9 pause
  316.     5.2.10 return
  317.     5.2.11 while, endwhile
  318.  
  319. 5.3 String operation commands
  320.  
  321.     5.3.1 str2int
  322.     5.3.2 strcompare
  323.     5.3.3 strconcat
  324.     5.3.4 strcopy
  325.     5.3.5 strlen
  326.     5.3.6 strscan
  327.  
  328. 5.4 File operation commands
  329.  
  330.     5.4.1 fileclose
  331.     5.4.2 fileconcat
  332.     5.4.3 filecopy
  333.     5.4.4 filecreate
  334.     5.4.5 filedelete
  335.     5.4.6 fileopen
  336.     5.4.7 filereadln
  337.     5.4.8 filerename
  338.     5.4.9 filesearch
  339.     5.4.10 fileseek
  340.     5.4.11 filestrseek
  341.     5.4.12 filewrite
  342.     5.4.13 filewriteln
  343.  
  344. 5.5 Miscellaneous commands
  345.  
  346.     5.5.1 beep
  347.     5.5.2 exec
  348.     5.5.3 getdate
  349.     5.5.4 gettime
  350.     5.5.5 inputbox
  351.     5.5.6 int2str
  352.     5.5.7 messagebox
  353.     5.5.8 passwordbox
  354.     5.5.9  show
  355.     5.5.10 yesnobox
  356.  
  357. ...............................................................................
  358. 5.1 Communication commands
  359.  
  360. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  361. 5.1.1 bplusrecv
  362.  
  363. Format:
  364.     bplusrecv
  365.  
  366. Causes Tera Term to receive a file from the host with the B-Plus protocol.
  367. Pauses until the end of the file transfer.
  368.  
  369. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  370. 5.1.2 bplussend
  371.  
  372. Format:
  373.     bplussend <filename>
  374.  
  375. Causes Tera Term to send the file <filename> to the host with the B-Plus
  376. protocol. Pauses until the end of the file transfer.
  377.  
  378. Example:
  379.     bplussend 'readme.txt'
  380.  
  381. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  382. 5.1.3 changedir
  383.  
  384. Format:
  385.     changedir <path>
  386.  
  387. Changes the current directory of Tera Term.
  388.  
  389. Example:
  390.     changedir 'c:\'
  391.  
  392. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  393. 5.1.4 closett
  394.  
  395. Format:
  396.     closett
  397.  
  398. Closes Tera Term.
  399.  
  400. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  401. 5.1.5 connect
  402.  
  403. Format:
  404.     connect <command line parameters>
  405.  
  406. Runs Tera Term with <command line parameters>, and links it to TTMACRO.
  407. If the link has been already established by Tera Term or another "connect"
  408. command, the "connect" command is ignored. No other communication commands
  409. should be executed before the link is established.
  410.  
  411. See CMNDLINE.TXT for the format of the <command line parameters>.
  412.  
  413. Example:
  414.     connect ''            No command line parameter
  415.  
  416.     connect '/C=2'            Run Tera Term with parameter '/C=2'.
  417.  
  418.     connect 'foohost.foo.foo.jp'
  419.  
  420.     CommandLine = '111.111.11.11'
  421.     connect CommandLine
  422.  
  423. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  424. 5.1.6 kmtrecv
  425.  
  426. Format:
  427.     kmtrecv
  428.  
  429. Causes Tera Term to receive a file from the host with the Kermit protocol.
  430. Pauses until the end of the file transfer.
  431.  
  432. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  433. 5.1.7 kmtsend
  434.  
  435. Format:
  436.     kmtsend <filename>
  437.  
  438. Causes Tera Term to send the file <filename> to the host with the Kermit
  439. protocol. Pauses until the end of the file transfer.
  440.  
  441. Example:
  442.     kmtsend 'readme.txt'
  443.  
  444. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  445. 5.1.8 logclose
  446.  
  447. Format:
  448.     logclose
  449.  
  450. Causes Tera Term to close the log file.
  451.  
  452. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  453. 5.1.9 logopen
  454.  
  455. Format:
  456.     logopen <filename> <binary flag> <append flag>
  457.  
  458. Causes Tera Term to start logging. Received characters are written to the file
  459. <filename>.
  460.  
  461. If <binary flag> is zero, received new-line characters are converted (CR ->
  462. CR/CRLF) and escape sequences are stripped out. If <binary flag> is non-zero,
  463. received characters are written without first being converted.
  464.  
  465. If <append flag> is non-zero and the file <filename> already exists, received
  466. characters are appended to it. If <append flag> is zero and the file <filename>
  467. already exists, the file is overwritten.
  468.  
  469. Example:
  470.     logopen 'myhost.log' 0 0
  471.  
  472. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  473. 5.1.10 logpause
  474.  
  475. Format:
  476.     logpause
  477.  
  478. Causes Tera Term to pause logging. Received characters are discarded while
  479. logging is paused.
  480.  
  481. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  482. 5.1.11 logstart
  483.  
  484. Format:
  485.     logstart
  486.  
  487. Causes Tera Term to restart the logging, if paused.
  488.  
  489. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  490. 5.1.12 logwrite
  491.  
  492. Format:
  493.     logwrite <string>
  494.  
  495. Appends a <string> to the log file of the Tera Term.
  496.  
  497. This command is valid only while Tera Term is logging. The <string> can be
  498. written even while logging is paused.
  499.  
  500. Example:
  501.     logwrite 'LOG FILE'#13#10
  502.  
  503. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  504. 5.1.13 quickvanrecv
  505.  
  506. Format:
  507.     quickvanrecv
  508.  
  509. Causes Tera Term to receive a file from the host with the Quick-VAN protocol.
  510. Pauses until the end of the file transfer.
  511.  
  512. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  513. 5.1.14 quickvansend
  514.  
  515. Format:
  516.     quickvansend <filename>
  517.  
  518. Causes Tera Term to send the file <filename> to the host with the Quick-VAN
  519. protocol. Pauses until the end of the file transfer.
  520.  
  521. Example:
  522.     quickvansend 'readme.txt'
  523.  
  524. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  525. 5.1.15 send
  526.  
  527. Format:
  528.     send <data1> <data2> ....
  529.  
  530. Causes Tera Term to send characters to the host.
  531.  
  532. If <data> is a string, the string is sent to the host. If <data> is an
  533. integer, its low-order byte (0-255) is regarded as an ASCII code of the
  534. character, and the character is sent to the host.
  535.  
  536. Example:
  537.     send 'ABC'
  538.  
  539.     send  65 66 67        Send 'ABC'.
  540.                 (ASCII code of the character "A" is 65.)
  541.  
  542.     myname='Tera Term'
  543.     send 'My name is ' myname '.'
  544.  
  545. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  546. 5.1.16 sendfile
  547.  
  548. Format:
  549.     sendfile <filename> <binary flag>
  550.  
  551. Causes Tera Term to send the file <filename> to the host. Pauses until the end
  552. of the file transfer.
  553.  
  554. If <binary flag> is non-zero, the file is sent without being converted. If
  555. <binary flag> is zero, new-line characters are converted (CR -> CR/CRLF) and
  556. control characters except TAB, LF, and CR are not sent.
  557.  
  558. Example:
  559.     sendfile 'data.dat' 1
  560.  
  561. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  562. 5.1.17 sendln
  563.  
  564. Format:
  565.     sendln <data1> <data2> ....
  566.  
  567. Causes Tera Term to send characters followed by a new-line character to the
  568. host.
  569.  
  570. Format of <data> is the same as the "send" command (5.1.15).
  571.  
  572. Example:
  573.     sendln            Only a new-line character is sent.
  574.  
  575.     sendln 'abc'
  576.  
  577.     Password='mypassword'
  578.     sendln Password
  579.  
  580. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  581. 5.1.18 showtt
  582.  
  583. Format:
  584.     showtt <show flag>
  585.  
  586. Minimizes Tera Term if <show flag> is zero.
  587. Restores Tera Term if <show flag> is non-zero.
  588.  
  589. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  590. 5.1.19 wait
  591.  
  592. Format:
  593.     wait <string1> <string2> ...
  594.  
  595. Pauses until one of the strings is received from the host, or until the
  596. time-out occurs. Maximum number of the strings is 10.
  597.  
  598. If the system variable "timeout" is greater than zero, the time-out occurs
  599. when <timeout> seconds have passed. If the "timeout" is less than or equal to
  600. zero, the time-out never occurs.
  601.  
  602. The "wait" command returns the following values in the system variable
  603. "result":
  604.  
  605.     Value        Meaning
  606.     -------------------------------------------------------
  607.     0        Time-out. No string has received.
  608.     1        <string1> has received.
  609.     2        <string2> has received.
  610.     .            .
  611.     .            .
  612.     .            .
  613.  
  614. Example:
  615.     timeout = 30            The time-out limit is 30 sec.
  616.     wait 'OK' 'ERROR'        Wait until 'OK' or 'ERROR' has
  617.                     received.
  618.     if result=0 goto timeout    If time-out, go to ':timeout'.
  619.     if result=1 goto ok        If 'OK' has received, go to ':ok'.
  620.     if result=2 goto error
  621.  
  622.     wait #10'>' 'complete.'#13    Wait a line beginning with the ">" or
  623.                     a line ending with the "complete.".
  624.                     (ASCII code of LF is 10, and CR is 13.)
  625.  
  626. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  627. 5.1.20 waitrecv
  628.  
  629. Format:
  630.     waitrecv <sub-string> <len> <pos>
  631.  
  632. Pauses until a string, which satisfies a condition, is received from
  633. the host, or until the time-out occurs.
  634.  
  635. The condition is:
  636.     The length of the string is <len>, and the string contains
  637.     the <sub-string> beginning at the <pos>th character.
  638.  
  639. For example, if <sub-string> is "def" and <len> is 9 and <pos> is 4,
  640. the string "abcdefghi" satisfies the condition.
  641.  
  642. If such string is received, it is saved in the system variable "inputstr".
  643.  
  644. If the system variable "timeout" is greater than zero, the time-out occurs
  645. when <timeout> seconds have passed. If the "timeout" is less than or equal
  646. to zero, the time-out never occurs.
  647.  
  648. The "waitrecv" command returns the following values in the system variable
  649. "result":
  650.  
  651. Value        Meaning
  652. ----------------------------------------------------------------------------
  653. -1        A string, which contains the <sub-string> beginning at the
  654.         <pos>th character, has been received, and saved in the 
  655.         "inputstr", but its length is less than <len> because of
  656.         the time-out.
  657.  
  658. 0        Time-out. No string, which satisfies the condition, has
  659.         been received.
  660.  
  661. 1        A string, which satisfies the condition, has been received,
  662.         and saved in the "inputstr".
  663.  
  664. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  665. 5.1.21 xmodemrecv
  666.  
  667. Format:
  668.     xmodemrecv <filename> <binary flag> <option>
  669.  
  670. Causes Tera Term to receive the file <filename> from the host with the XMODEM
  671. protocol. Pauses until the end of the file transfer.
  672.  
  673. If the file is a binary file, <binary flag> must be non-zero. If the file is
  674. a text file, <binary flag> must be zero.
  675.  
  676. <option> specifies the XMODEM option, and can be one of the following:
  677.  
  678.     <option>    XMODEM option
  679.     --------------------------
  680.     1        Checksum
  681.     2        CRC
  682.     3        1K
  683.     others        Checksum
  684.  
  685. Example:
  686.     xmodemrecv 'readme.txt' 0 2    XMODEM receive, text file, CRC
  687.  
  688. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  689. 5.1.22 xmodemsend
  690.  
  691. Format:
  692.     xmodemsend <filename> <option>
  693.  
  694. Causes Tera Term to send the file <filename> to the host with the XMODEM
  695. protocol. Pauses until the end of the file transfer.
  696.  
  697. <option> specifies the XMODEM option, and can be one of the following:
  698.  
  699.     <option>    XMODEM option
  700.     --------------------------
  701.     1        Checksum
  702.     2        CRC
  703.     3        1K
  704.     others        Checksum
  705.  
  706. Example:
  707.     xmodemsend 'readme.txt' 1    XMODEM send, checksum
  708.  
  709. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  710. 5.1.23 zmodemrecv
  711.  
  712. Format:
  713.     zmodemrecv
  714.  
  715. Causes Tera Term to receive files from the host with the ZMODEM protocol.
  716. Pauses until the end of the file transfer.
  717.  
  718. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  719. 5.1.24 zmodemsend
  720.  
  721. Format:
  722.     zmodemsend <filename> <binary flag>
  723.  
  724. Causes Tera Term to send the file <filename> to the host with the ZMODEM
  725. protocol. Pauses until the end of the file transfer.
  726.  
  727. If the file is a binary file, <binary flag> must be non-zero. If the file is
  728. a text file, <binary flag> must be zero.
  729.  
  730. Example:
  731.     zmodem 'readme.txt' 0
  732.  
  733. ...............................................................................
  734. 5.2 Control commands
  735.  
  736. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  737. 5.2.1 call
  738.  
  739. Format:
  740.     call <label>
  741.  
  742. Calls a subroutine beginning with the <label> line.
  743.  
  744. Example:
  745.     messagebox "I'm in main." "test"
  746.     call sub                Jump to ":sub".
  747.     messagebox "Now I'm in main" "test"
  748.     end
  749.  
  750.     :sub                    Start of the subroutine.
  751.       messagebox "Now I'm in sub" "test"
  752.       return                Go back to the main routine.
  753.  
  754. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  755. 5.2.2 end
  756.  
  757. Format:
  758.     end
  759.  
  760. Quits the execution of the macro. TTMACRO is also closed.
  761.  
  762. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  763. 5.2.3 execcmnd
  764.  
  765. Format:
  766.     execcmnd <statement>
  767.  
  768. Executes a TTL statement expressed by the string <statement>.
  769.  
  770. Example:
  771.     execcmnd "send 'abc'"        Execute the statement "send 'abc'".
  772.  
  773.     execcmnd "a=1"
  774.  
  775. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  776. 5.2.4 exit
  777.  
  778. Format:
  779.     exit
  780.  
  781. Exits the include file and returns to the main file.
  782.  
  783. Example:    See 5.2.8.
  784.  
  785. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  786. 5.2.5 for, next
  787.  
  788. Format:
  789.     for <intvar> <first> <last>
  790.       ...
  791.       ...
  792.     next
  793.  
  794. Repeats the statements between "for" and "next" until the integer variable
  795. <intvar> has the value <last> at the 'next' statement.
  796.  
  797. The initial value of the <intvar> is <first>. If <last> is greater than
  798. <first>, <intvar> is incremented by 1 at the 'next' line. If <last> is less
  799. than <first>, <intvar> is decremented by 1 at the 'next' line.
  800.  
  801. Example:
  802.     for i 1 10        Repeat ten times.
  803.       sendln 'abc'
  804.     next
  805.  
  806.     for i 5 1        Repeat five times.
  807.       sendln 'abc'
  808.     next
  809.  
  810. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  811. 5.2.6 goto
  812.  
  813. Format:
  814.     goto <label>
  815.  
  816. Moves control to the next line of the <label>.
  817.  
  818. Example:
  819.     goto label        Jump to the next line of the ':label'.
  820.     ...
  821.     ...
  822.     ...
  823.     :label
  824.     send 'abc'
  825.  
  826. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  827. 5.2.7 if, then, elseif, else, endif
  828.  
  829. 1) Format:
  830.     if <int> <statement>
  831.  
  832. Executes a <statement>, if <int> is non-zero.
  833.  
  834. Example:
  835.     if A>1 goto label        If A>1, jump to ':label'.
  836.  
  837.     if result A=0            If result<>0, assign 0 to A.
  838.  
  839. 2) Format:
  840.     if <int 1> then
  841.       ...
  842.       (Statements for the case:  <int 1> is true (non-zero).)
  843.       ...
  844.     [elseif <int 2>]
  845.       ...
  846.       (Statements for the case:  <int 1> is false (zero) and
  847.        <int 2> is true.)
  848.       ...
  849.       ...
  850.     [elseif <int N>]
  851.       ...
  852.       (Statements for the case:  <int 1>, <int 2>,.., and
  853.        <int N-1> are all false, and <int N> is true.)
  854.       ...
  855.     [else]
  856.       ...
  857.       (Statements for the case:  all the conditions above
  858.        are false (zero).)
  859.       ...
  860.     endif
  861.  
  862. 'if' statement must end with 'then'.
  863. 'elseif' and 'else' can be omitted.
  864. 'then' and 'endif' can not be omitted.
  865.  
  866. Examples:
  867.     if a=1 then
  868.       b = 1
  869.       c = 2
  870.       d = 3
  871.     endif
  872.  
  873.     if i<0 then
  874.       i=0
  875.     else
  876.       i=i+1
  877.     endif
  878.  
  879.     if i=1 then
  880.       c = '1'
  881.     elseif i=2
  882.       c = '2'
  883.     elseif i=3
  884.       c = '3'
  885.     else
  886.       c = '?'
  887.     endif
  888.  
  889. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  890. 5.2.8 include
  891.  
  892. Format:
  893.     include <include file name>
  894.  
  895. Moves control to the include file.
  896.  
  897. Example:
  898.     ----- main file 'main.ttl' ------
  899.     i=10
  900.     :loop
  901.     include 'sub.ttl'        Move to the include file.
  902.     if i>=0 goto loop
  903.     end
  904.     ---------------------------------
  905.  
  906.     ----- include file 'sub.ttl' ----
  907.     if i<0 then
  908.       messagebox 'error!' 'sub'
  909.       exit                Go back to the main file.
  910.     endif
  911.     i = i - 1
  912.     ----- End of 'sub.ttl' ----------    Go back to the main file.
  913.  
  914. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  915. 5.2.9 pause
  916.  
  917. Format:
  918.     pause <time>
  919.  
  920. Pauses for <time> seconds.
  921.  
  922. Example:
  923.  
  924.     pause 10    Pause for 10 seconds.
  925.  
  926.     pause Time
  927.  
  928. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  929. 5.2.10 return
  930.  
  931. Format:
  932.     return
  933.  
  934. Exits the subroutine and returns to the main routine.
  935.  
  936. Example: See 5.2.1.
  937.  
  938. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  939. 5.2.11 while, endwhile
  940.  
  941. Format:
  942.     while <int>
  943.       ...
  944.       ...
  945.       ...
  946.     endwhile
  947.  
  948. Repeats the statements between 'while' and 'endwhile' while <int> is non-zero.
  949.  
  950. Examples:
  951.     i = 10
  952.     while i>0
  953.       i = i - 1    Repeat ten times.
  954.     endwhile
  955.  
  956. ...............................................................................
  957. 5.3 String operation commands
  958.  
  959. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  960. 5.3.1 str2int
  961.  
  962. Format:
  963.     str2int <intvar> <string>
  964.  
  965. Converts the <string> which represents a decimal number to its numeric value.
  966. The value is returned in the integer variable <intvar>. If the string is
  967. converted successfully, the system variable "result" is set to 1. Otherwise,
  968. "result" is set to zero.
  969.  
  970. Example:
  971.     str2int val '123'        val=123, result=1
  972.  
  973.     str2int val '123abc'        result=0
  974.  
  975. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  976. 5.3.2 strcompare
  977.  
  978. Format:
  979.     strcompare <string1> <string2>
  980.  
  981. Compares two strings. Depending on the relation between them, one of the
  982. following result code is returned in the system variable "result":
  983.  
  984.     Relation        result
  985.   ---------------------------------------
  986.   <string1> < <string2>         -1
  987.   <string1> = <string2>          0
  988.   <string1> > <string2>          1
  989.  
  990. Example:
  991.     strcompare 'abc' 'def'        result = -1
  992.  
  993.     strcompare command 'next'
  994.     if result=0 goto label
  995.     strcompare command 'end'
  996.     if result=0 end
  997.  
  998. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  999. 5.3.3 strconcat
  1000.  
  1001. Format:
  1002.     strconcat <strvar> <string>
  1003.  
  1004. Appends a copy of <string> to the end of the string variable <strvar>.
  1005.  
  1006. Example:
  1007.     filename = 'c:\teraterm\'
  1008.     strconcat filename 'test.txt'
  1009.  
  1010. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1011. 5.3.4 strcopy
  1012.  
  1013. Format:
  1014.     strcopy <string> <pos> <len> <strvar>
  1015.  
  1016. Copies a substring of <string> to the string variable <strvar>.
  1017. The substring begings at the <pos>th character in <string>, and its length
  1018. is <len>.
  1019.  
  1020. Example:
  1021.     strcopy 'tera term' 6 4 substr        substr='term'
  1022.  
  1023. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1024. 5.3.5 strlen
  1025.  
  1026. Format:
  1027.     strlen <string>
  1028.  
  1029. Returns the length of <string> in the system variable "result".
  1030.  
  1031. Example:
  1032.     strlen 'abc'            result = 3
  1033.  
  1034. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1035. 5.3.6 strscan
  1036.  
  1037. Format:
  1038.     strscan <string> <substring>
  1039.  
  1040. Searches for <substring> in <string>.
  1041. If <substring> is found, its position is returned in the system variable
  1042. "result". If <string> contains more than one occurrence of <substring>,
  1043. the position of the first one is returned. If <substring> is not found,
  1044. "result" is set to zero.
  1045.  
  1046. Example:
  1047.     strscan 'tera term' 'term'        result = 6
  1048.  
  1049. ...............................................................................
  1050. 5.4 File operation commands
  1051.  
  1052. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1053. 5.4.1 fileclose
  1054.  
  1055. Format:
  1056.     fileclose <file handle>
  1057.  
  1058. Closes the file specified by <file handle>.
  1059. <file handle> is no longer valid after this command.
  1060.  
  1061. Example:
  1062.     fileclose fhandle
  1063.  
  1064. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1065. 5.4.2 fileconcat
  1066.  
  1067. Format:
  1068.     fileconcat <file1> <file2>
  1069.  
  1070. Appends a copy of file <file2> to the end of file <file1>.
  1071. <file1> and <file2> must not be same.
  1072.  
  1073. Example:
  1074.     fileconcat 'test.dat' test2.dat'
  1075.  
  1076. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1077. 5.4.3 filecopy
  1078.  
  1079. Format:
  1080.     filecopy <file1> <file2>
  1081.  
  1082. Copies file <file1> to file <file2>.
  1083. If <file2> already exists, it is overwritten. <file1> and <file2> must not
  1084. be same.
  1085.  
  1086. Example:
  1087.     filecopy 'test.dat' test2.dat'
  1088.  
  1089. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1090. 5.4.4 filecreate
  1091.  
  1092. Format:
  1093.     filecreate <file handle> <filename>
  1094.  
  1095. Creates and opens a new file specified by <filename>.
  1096. The file pointer is set to the beginning of the file. If file <filename>
  1097. already exists, its size is truncated to zero. If the file is successfully
  1098. created and opened, the file handle is returned in the integer variable
  1099. <file handle>. Otherwise, <file handle> is set to -1.
  1100.  
  1101. Example:
  1102.     filecreate fhandle 'data.dat'
  1103.  
  1104. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1105. 5.4.5 filedelete
  1106.  
  1107. Format:
  1108.     filedelete <filename>
  1109.  
  1110. Deletes the file specified by <filename>.
  1111.  
  1112. Example:
  1113.     filedelete 'temp.log'
  1114.  
  1115. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1116. 5.4.6 fileopen
  1117.  
  1118. Format:
  1119.     fileopen <file handle> <file name> <append flag>
  1120.  
  1121. Opens a file specified by <file name>.
  1122.  
  1123. If the file does not exist, it is created and then opened. If the file is
  1124. successfully opened, the file handle is returned in the integer variable
  1125. <file handle>. Otherwise, <file handle> is set to -1.
  1126.  
  1127. If <append flag> is zero, the file pointer is set to the beginning of the
  1128. file. If <append flag> is non-zero, the file pointer is set to the end of
  1129. the file.
  1130.  
  1131. Example:
  1132.     fileopen fhandle 'data.dat' 0
  1133.  
  1134.     fileopen fhandle 'data.dat' 1
  1135.  
  1136. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1137. 5.4.7 filereadln
  1138.  
  1139. Format:
  1140.     filereadln <file handle> <strvar>
  1141.  
  1142. Reads a line from the file specified by <file handle>.
  1143. The line is written into the string variable <strvar>. The file pointer
  1144. is moved to the beginning of the next line. If the file pointer reaches the
  1145. end of the file while reading the line, the system variable "result" is set
  1146. to 1. Otherwise, "result" is set to zero.
  1147.  
  1148. Example:
  1149.     fileopen fhandle 'test.txt' 0    Open a file.
  1150.     :loop
  1151.     filereadln fhandle line        Read a line from the file.
  1152.     if result goto fclose
  1153.     messagebox line 'test.txt'    Display the line.
  1154.     goto loop            Repeat until the end of the file.
  1155.     :fclose
  1156.     fileclose fhandle        Close the file.
  1157.  
  1158. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1159. 5.4.8 filerename
  1160.  
  1161. Format:
  1162.     filerename <file1> <file2>
  1163.  
  1164. Renames <file1> to <file2>.
  1165. <file1> and <file2> must not be same.
  1166.  
  1167. Example:
  1168.     filerename 'test.dat' test2.dat'
  1169.  
  1170. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1171. 5.4.9 filesearch
  1172.  
  1173. Format:
  1174.     filesearch <filename>
  1175.  
  1176. Searches for the file specified by <filename>.
  1177. If it is found, the system variable "result" is set to 1. Otherwise,
  1178. "result" is set to zero.
  1179.  
  1180. Example:
  1181.     filesearch 'readme.txt'
  1182.     if result=0 messagebox 'File not found.' 'error'
  1183.  
  1184. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1185. 5.4.10 fileseek
  1186.  
  1187. Format:
  1188.     fileseek <file handle> <offset> <origin>
  1189.  
  1190. Moves the pointer for the file specified by <file handle>.
  1191. With this command, the file pointer is moved <offset> bytes from:
  1192.  
  1193.     the beginning of the file, if <origin> is 0.
  1194.  
  1195.     the current position, if <origin> is 1.
  1196.  
  1197.     the end of the file, if <offset> is 2.
  1198.  
  1199. Example:
  1200.     fileseek fhandle 0 0    Move to the beginning of the file.
  1201.  
  1202.     fileseek fhandle 10 1    Move 10 bytes from the current position.
  1203.  
  1204.     fileseek fhandle 0 2    Move to the end of the file.
  1205.  
  1206. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1207. 5.4.11 filestrseek
  1208.  
  1209. Format:
  1210.     filestrseek <file handle> <string>
  1211.  
  1212. Searches for <string> in the file specified by <file handle>.
  1213. The search is started from the current position of the file pointer.
  1214.  
  1215. If <string> is found, the file pointer is moved to the next character of
  1216. the string, and the system variable "result" is set to 1. If <string> is
  1217. not found, the file pointer is not moved, and "result" is set to zero.
  1218.  
  1219. Example:
  1220.     fileopen fhandle 'teraterm.log' 0    Search for the string 'abc'
  1221.     filestrseek fhandle 'abc'        in the file 'teraterm.log'.
  1222.     if result=0 goto not_found
  1223.     filereadln fhandle str            Read characters from the next
  1224.                         of the 'abc' to the end of the
  1225.                         line.
  1226.     :not_found
  1227.     fileclose fhandle
  1228.  
  1229. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1230. 5.4.12 filewrite
  1231.  
  1232. Format:
  1233.     filewrite <file handle> <string>
  1234.  
  1235. Writes <string> to the file specified by <file handle>.
  1236.  
  1237. Example:
  1238.     filewrite fhandle '---------cut here---------'#13#10
  1239.  
  1240. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1241. 5.4.13 filewriteln
  1242.  
  1243. Format:
  1244.     filewriteln <file handle> <string>
  1245.  
  1246. Writes <string> and the new-line characters (CR+LF) to the file specified
  1247. by <file handle>.
  1248.  
  1249. Example:
  1250.     filewriteln fhandle '---------cut here---------'
  1251.  
  1252. ...............................................................................
  1253. 5.5 Miscellaneous commands
  1254.  
  1255. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1256. 5.5.1 beep
  1257.  
  1258. Format:
  1259.     beep
  1260.  
  1261. Makes a beep sound.
  1262.  
  1263. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1264. 5.5.2 exec
  1265.  
  1266. Format:
  1267.     exec <command line>
  1268.  
  1269. Runs an application specified by <command line>.
  1270.  
  1271. Format:
  1272.     exec 'notepad readme.txt'    Run "Notepad".
  1273.  
  1274. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1275. 5.5.3 getdate
  1276.  
  1277. Format:
  1278.     getdate <strvar>
  1279.  
  1280. Returns the current date in the string variable <strvar>, with the format
  1281. "YYYY-MM-DD".
  1282.  
  1283. Example:
  1284.     getdate datestr
  1285.  
  1286. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1287. 5.5.4 gettime
  1288.  
  1289. Format:
  1290.     gettime <strvar>
  1291.  
  1292. Returns the current time in the string variable <strvar>, with the format
  1293. "HH:MM:SS".
  1294.  
  1295. Example:
  1296.     gettime timestr
  1297.  
  1298. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1299. 5.5.5 inputbox
  1300.  
  1301. Format:
  1302.     inputbox <message> <title>
  1303.  
  1304. Displays a dialog box prompting user to input a string.
  1305.  
  1306. The <message> is displayed in the dialog box. The <title> is displayed as the
  1307. dialog box title. The string entered by the user is returned in the system
  1308. variable "inputstr".
  1309.  
  1310. Example:
  1311.     inputbox 'Password:' 'Login'
  1312.     sendln inputstr
  1313.  
  1314. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1315. 5.5.6 int2str
  1316.  
  1317. Format:
  1318.     int2str <strvar> <integer value>
  1319.  
  1320. Converts <integer value> to its string expression, and returns it in the
  1321. string variable <strvar>.
  1322.  
  1323. Example:
  1324.     int2str valstr 123        The string "123" is assigned to
  1325.                     the variable 'valstr'.
  1326.  
  1327. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1328. 5.5.7 messagebox
  1329.  
  1330. Format:
  1331.     messagebox <message> <title>
  1332.  
  1333. Displays a dialog box with <message> and <title>.
  1334.  
  1335. Example:
  1336.     messagebox ErrorMessage 'Error'
  1337.  
  1338. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1339. 5.5.8 passwordbox
  1340.  
  1341. Format:
  1342.     passwordbox <message> <title>
  1343.  
  1344. Displays a dialog box prompting the user to input a password.
  1345.  
  1346. The <message> is displayed in the dialog box. The <title> is displayed as the
  1347. dialog box title. The password typed by the user is not displayed as is.
  1348. Instead, asterisks are displayed. The password is returned in the system
  1349. variable "inputstr".
  1350.  
  1351. Example:
  1352.     passwordbox 'Enter password' 'Login'
  1353.  
  1354. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1355. 5.5.9 show
  1356.  
  1357. Format:
  1358.     show <show flag>
  1359.  
  1360. Minimizes TTMACRO, if <show flag> is zero.
  1361. Restores TTMACRO, if <show flag> is non-zero.
  1362.  
  1363. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1364. 5.5.10 yesnobox
  1365.  
  1366. Format:
  1367.     yesnobox <message> <title>
  1368.  
  1369. Displays a dialog box with the <message>, the <title>, a "Yes" button, and a
  1370. "No" button.
  1371.  
  1372. If the user clicks on the "Yes" button, the system variable "result" is set
  1373. to 1.  If the user clicks on the "No" button, "result" is set to zero.
  1374.  
  1375. Example:
  1376.     yesnobox 'Try agian?' 'Tera Term'
  1377.     if result goto retry
  1378.     end
  1379.  
  1380. -------------------------------------------------------------------------------
  1381.  6. Appendixes
  1382.  
  1383. ...............................................................................
  1384. Appendix A    Error messages
  1385.  
  1386.  Error message                Meaning
  1387.  ----------------------------------------------------------------------------
  1388.  Can't call sub.        Cannot call the subroutine, the subroutine
  1389.                 is located in a different file.
  1390.  
  1391.  Can't link macro.        Failure to establish the connection between
  1392.                 TTMACRO and Tera Term.
  1393.  
  1394.  Can't open file.        The include file does not exist, or there are
  1395.                 too many nested include files.
  1396.  
  1397.  ")" expected.            A closing parenthesis does not exist where
  1398.                 it should.
  1399.  
  1400.  Link macro first.        The command cannot be executed before the
  1401.                 connection between TTMACRO and Tera Term is
  1402.                 established.
  1403.  
  1404.  Divide by zero.        The expression attempts to divide by zero.
  1405.  
  1406.  Invalid control.        Invalid use of "else", "elseif", or "endif".
  1407.  
  1408.  Label already defined.        Duplicate use of the label.
  1409.  
  1410.  Label required.        The label is not defined.
  1411.  
  1412.  Stack overflow.        There are too many nested subroutines,
  1413.                 "for-next" loops, or "while-endwhile" loops.
  1414.  
  1415.  Syntax error.            The format of the statement is invalid.
  1416.  
  1417.  Too many labels.        TTMACRO cannot handle more than 256 labels.
  1418.  
  1419.  Too many variables.        TTMACRO cannot handle more than 128 integer
  1420.                 variables and 128 string variables.
  1421.  
  1422.  Type mismatch.            The type of the constant or the variable is
  1423.                 invalid.
  1424.  
  1425.  Variable not initialized.    The variable must be initialized before it is
  1426.                 referenced.
  1427.  
  1428. ...............................................................................
  1429. Appendix B    About new-line characters
  1430.  
  1431. New-line characters (CR or CR+LF) received from the host are converted to
  1432. CR+LF pairs by Tera Term, and then Tera Term sends them to TTMACRO.
  1433.  
  1434. You should use the pair (CR+LF) as a new-line character to send to Tera Term.
  1435.  
  1436. ASCII code 13 (decimal) is for the CR, and 10 is for the LF.
  1437.  
  1438. Example:
  1439.   send 'abc'#13#10        Same as the statement "sendln 'abc'". The
  1440.                 actual new-line character to be sent to the
  1441.                 host is determined by Tera Term.
  1442.  
  1443.   wait #10'abc' 'def'#13    Waits for a line beginning with "abc",
  1444.                 or a line ending with 'def'.
  1445.  
  1446.   logwrite 'abc'#13#10        Writes line "abc" to the log file.
  1447.  
  1448. ...............................................................................
  1449.  
  1450. -------------------------------------------------------------------------------