(Created page with "<seo title="Multiple Line String Arguements | vEdit" description="How to use multiple line string arguments in command mode."></seo> {{DISPLAYTITLE:Multiple Line String Argum...")
 
(Other Resources)
 
(One intermediate revision by the same user not shown)
Line 30: Line 30:
  
 
<pre>Message("Line 1\nLine 2\nLine 3")</pre>
 
<pre>Message("Line 1\nLine 2\nLine 3")</pre>
 +
 +
==Other Resources==
 +
*[[Command Mode| Command Mode Overview]]
 +
*[[Command Line|Command Line Overview]]

Latest revision as of 20:47, 16 January 2017


The string argument in commands such as Search("ss"), Ins_Text("text") and Message("mtext") can be several lines long. If you press Enter before the second delimiter, the "newline" becomes part of the string argument and the command waits for the rest of its string — the command prompt then changes to "-".

Prompt "-"
VEDIT is waiting for the second string delimiter.

For example, the following command will search for two lines:

Search("This is line 1<Enter>
This is line 2")<Enter>

Prompt changes to "-" here.

The screen display just before pressing the second Enter is:

COMMAND: Search("This is line 1
-This is line 2")

The "-" command prompt is normal for string arguments that contain Enter. However, if you have made a mistake and unexpectedly receive the "-" prompt, press CANCEL Ctrl-\ or Ctrl-C to abort the command.

The Message( ) command can take a multiple line string argument or the sequence "\n" can be used be specify a "newline". Therefore the following two commands are equivalent.

Message("Line 1
Line 2
Line 3")
Message("Line 1\nLine 2\nLine 3")

Other Resources