×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

What does \ and \\ Mean in VFP Code?

What does \ and \\ Mean in VFP Code?

What does \ and \\ Mean in VFP Code?

(OP)
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

RE: What does \ and \\ Mean in VFP Code?

Hi Stanley,

You may want to have a look at the help file

Quote (Help File)



\ 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.

RE: What does \ and \\ Mean in VFP Code?

(OP)
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

RE: What does \ and \\ Mean in VFP Code?

It simply outputs a comma.

Chriss

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close