(→String Arguments) |
(→String Arguments) |
||
| Line 33: | Line 33: | ||
Although not available for all string arguments, all filename arguments plus the '''Search( )''', '''Replace( )''', '''Match( )''' , '''Statline_Message( )''' , '''System( )''' and '''Goto''' commands can use a text register as a portion of the string argument. Thesyntax '''|@(r)''' uses text register ''''r'''' as a portion of the string argument. | Although not available for all string arguments, all filename arguments plus the '''Search( )''', '''Replace( )''', '''Match( )''' , '''Statline_Message( )''' , '''System( )''' and '''Goto''' commands can use a text register as a portion of the string argument. Thesyntax '''|@(r)''' uses text register ''''r'''' as a portion of the string argument. | ||
| + | |||
| + | The following equivalent commands display a directory of all "chapter1.*" files in the current directory. | ||
| + | |||
| + | <pre>Directory("chapter1.*")</pre> | ||
| + | |||
| + | <pre>Reg_Set(10,"chapter1.*") | ||
| + | Directory(@10)</pre> | ||
| + | |||
| + | <pre>Reg_Set(10,"chapter1") | ||
| + | Directory("|@(10).*")</pre> | ||
| + | |||
| + | The predefined string values can be used anywhere that a string constant can be used. | ||
| + | |||
| + | ;Reg_Set(10,CUR_DIR) | ||
| + | :Set text register 10 to the pathname of the current directory. | ||
| + | |||
| + | Appendix '''D''' gives a description of all predefined string values. | ||
| + | |||
| + | ==Command Options== | ||
VEDIT commands take two types of arguments - numeric and string. Arguments must be enclosed in (...) following the command name. When there are two or more arguments, they must be separated from each other with commas.
Each numeric argument can be a numeric expression consisting of numeric constants (e.g. 12345), numeric variables (e.g. #10), reserved words (e.g. ALL) or the return value from a command (e.g. File_Size). More numeric expressions in detail.
Numeric arguments have the range of +/- 2,147,483,647. When a large number is needed, for example to specify an "infinite" repeat count, the reserved word "ALL" can be used; its value is greater than one billion.
For example, the command Print(n) prints 'n' lines of text. The command Print(1000000) could be used to print the entire file (up to 1 million lines anyway). However we recommend Print(ALL) - Print the entire file, starting at the current edit (cursor) position.
Each string argument can either be a string constant (e.g. "hello") a string variable stored in a text register (e.g. @20), or one of the predefined string values, (e.g. CUR_DIR).
A string constant is enclosed in "delimiters" that cannot occur in the string. The allowable delimiters are:
` ' " % & * , . : ; / ~ ^ =
As a convention, we use double-quotes as the string delimiters whenever possible. When the string contains double-quotes, we use single-quotes or the forward-slash.
Ins_Text(/The name is "TOM"/)
Since the normal double-quote character is part of the string constant, "/" is used as the string delimiter.
String arguments are often accessed from text registers which can be used as string "variables". The syntax @r uses text register 'r' as the entire string argument. The register can contain any characters, even including the string delimiter.
Reg_Set(20, /The name is "TOM"/) Ins_Text(@20)
Text register 20 is used as a string variable in the Ins_Text( ) command. It performs the same insertion as the previous example.
Although not available for all string arguments, all filename arguments plus the Search( ), Replace( ), Match( ) , Statline_Message( ) , System( ) and Goto commands can use a text register as a portion of the string argument. Thesyntax |@(r) uses text register 'r' as a portion of the string argument.
The following equivalent commands display a directory of all "chapter1.*" files in the current directory.
Directory("chapter1.*")
Reg_Set(10,"chapter1.*") Directory(@10)
Reg_Set(10,"chapter1")
Directory("|@(10).*")
The predefined string values can be used anywhere that a string constant can be used.
Appendix D gives a description of all predefined string values.