Processing Character Data
Developing TACL Programs
107365 Tandem Computers Incorporated
2–11
A character address specifies a particular character within a variable, counting from
the first character, whose character address is 1. Each end-of-line character (except the
last one in the variable) counts as one character. If a specified character address is
greater than the number of characters in the variable, that address is considered to be
equivalent to the address of the character that appears after the last character in the
variable.
A line address specifies a particular line within a variable, counting from the first line,
whose line address is 1. If a specified line address is greater than the number of lines
in the variable, that address is considered to be equivalent to the address of the line
that appears after the last line in the variable. If the variable changes, the assumed line
numbers will be different on the next operation. Unlike line numbers in an edit-format
file, these assumed line numbers are not saved.
For example, a variable called
sample
contains three lines of text:
10> #PUSH sample
11> #APPEND sample This variable is called "sample."
12> #APPEND sample It contains three lines of text.
13> #APPEND sample The contents will be edited by built-in
functions.
14> #OUTPUTV sample
This variable is called "sample."
It contains three lines of text.
The contents will be edited by built-in functions.
15>
To retrieve the number of lines, enter:
11> #LINECOUNT sample
#LINECOUNT sample expanded to:
3
12>
To retrieve the number of characters, enter:
12> #CHARCOUNT sample
#CHARCOUNT sample expanded to:
117
13>
To find the line address of the first line that contains “text,” starting at line 1, enter:
13> #LINEFINDV sample 1 "text"
#LINEFINDV sample 1 "text" expanded to:
2
14>