Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What does \ and \\ Mean in VFP Code?

Status
Not open for further replies.

stanlyn

Programmer
Sep 3, 2003
945
US
Hi,

While looking at some sample code I see the use of \ and \\ as leading characters. Also, there are commas on some of the lines which I have also never seen before.
Code:
IF m.lnUseProgressBar = 1 THEN 
   \m.loProgress = CREATEOBJECT("progress") 
ENDIF
             && tcOutputName
\m.lnRetVal = m.loSession.SetParams("<<m.lcOutput>>",
             && tcTempDirectory
IF LEN(m.lcTempDirectory) > 0 THEN     
   \\"<<m.lcTempDirectory>>",
ELSE
   \\,
ENDIF
             && tlNotOpenViewer
IF m.lnView = 0 THEN         
   \\.T.,
ELSE
   \\,
ENDIF
I have never seen that usage before. Can someone explain?

Thanks,
Stanley
 
Hi Stanley,

You may want to have a look at the help file

Help File said:
\ TextLine
When you use \, the text line is preceded by a carriage return and a line feed.

\\ TextLine
When you use \\, the text line is not preceded by a carriage return and a line feed.

Any spaces preceding \ and \\ are not included in the output line, but spaces following \ and \\ are included.

You can embed an expression in the text line. If the expression is enclosed in the text merge delimiters (<< >> by default) and SET TEXTMERGE is ON, the expression is evaluated and its value is output as text.

Collapse imageRemarks
The \ and \\ commands facilitate text merge in Visual FoxPro. Text merge makes it possible for you to output text to a file to create form letters or programs.
 
Hi mjcmkrsr,

What do you know... It's in the help file and in all these years it was hidden in plain sight. Plus, I always assumed (incorrectly) \ and \\ were associated with paths and nothing else.

Now, what does the trailing comma mean as in:
\\,
as textmerge is not in play here.

Thanks,
Stanley
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top