MetroCad USA
String Manipulation and Printing Functions
String Manipulation
(STRCAT <string1>.....<stringn>)
Combines all strings in order to create a single string. (strcat "Greg"
"MacGeorge") retrurns "Greg MacGeorge" as a single string.
(STRLEN <string>)
Returns the number of characters in a string as an integer type. (strlen
"macgeorge") returns 9.
(SUBSTR <string> <start-int> <length-int>)
Creates a substring of <string> starting at the <start-int> character
position and continuing for <length-int> characters. The return is a string.
<start-int> and <length-int> must be integers. The first character is number
one. (substr "macgeorge" 4 6) returns "george".
(STRCASE <string> [<which>])
Converts all characters in <string> to upper or lower case. If <which> is
non-nil, the conversion of <string> is to all lower case. If <which> is nil,
or not present, the conversion of <string> is to all upper case characters. (strcase
"macgeorge") returns "MACGEORGE" (strcase "MacGeorge" T)
returns "macgeorge"
String Printing
(PROMPT <string>)
Displays <string> statement in the screen prompt area and returns nil. (prompt
"Please enter a number") returns "Please enter a number" in the
screeen prompt area on the command line.
(PRINC <expr> [<filedesc>])
Prints and returns the value of <expr> to the screen area. <expr> can be
of any Data Type and can be symbols or variables. The value of a variable is displayed. If
[<filedesc>] is present and the file is open for writing output is written to the
file. A variable named txt3 has a value of 25.60. (princ txt3) returns 25.60 to the screen
area (command line). (princ txt3 file1) returns 25.60 to the screen and writes 25.60 to
file1.
(PRIN1 <expr> [<filedesc>])
This works the same as PRINC however, control codes are not interpreted. A variable
named txt3 has a value of 25.60. (prin1 txt3) returns 25.60 to the screen area (command
line). (prin1 txt3 file1) returns 25.60 to the screen and writes 25.60 to file1.
Example functions page
Back Home