PRB: Code Copied From MSDN VStudio Help Is Improperly Formatted
ID: Q190266
|
The information in this article applies to:
-
MSDN Library
-
Microsoft Visual Studio 6.0
-
Microsoft Visual FoxPro for Windows, version 6.0
-
Microsoft Visual Basic Enterprise Edition for Windows, version 6.0
-
Microsoft Visual Basic Professional Edition for Windows, version 6.0
-
Microsoft Visual C++, 32-bit Editions, version 6.0
-
Microsoft Visual J++, version 6.0
SYMPTOMS
When you copy code examples from the MSDN Library Visual Studio 6.0 Help
Viewer, it omits some carriage return/line feed characters and the code is
not formatted correctly.
CAUSE
Formatting tags are included at the start and end of each example, and the
code is not be formatted properly if you do not copy these tags.
RESOLUTION
When copying code, be sure to completely include the first and last lines
of the code example.
STATUS
Microsoft is researching this problem and will post new information here in
the Microsoft Knowledge Base as it becomes available.
MORE INFORMATION
The documentation for Visual Studio 6.0 is accessed from a common viewer
called MSDN Library Visual Studio 6.0 Help Viewer. All Visual Studio 6.0
products that have code examples are affected by this problem. These
include, but may not be limited to, Visual FoxPro 6.0, Visual Basic 6.0,
Visual C++ 6.0 and Visual J++ 6.0.
Steps to Reproduce Behavior
Using Visual FoxPro:
- In Visual FoxPro, type the following in the Command Window and press
enter:
help DATE()
- In the DATE() Function topic page, click the Example hyperlink.
- Using your mouse, select any multiple-line portion of the code in the
example that excludes either the first or last lines of the code, or
both.
- Press Ctrl+C to copy the highlighted code.
- Paste the code into an edit window in Visual FoxPro, or into another
application such as Notepad.
RESULT: Some of the line feeds are omitted. Using the DATE() Function
example, if you copy the second, third, and fourth lines the code is
formatted as follows:
SET CENTURY OFF? DATE( ) && Displays today's date without the century.
SET CENTURY ON
The correct formatting is:
SET CENTURY OFF
? DATE( ) && Displays today's date without the century.
SET CENTURY ON
If you copy the entire code example, including the entire first and last
lines, the code is formatted as follows:
CLEAR
SET CENTURY OFF
? DATE( ) && Displays today's date without the century.
SET CENTURY ON
? DATE( ) && Displays today's date with the century.
? DATE(1998, 02, 16) && Displays a year 2000-compliant Date value.
Using Visual Basic:
- In Visual Basic Help, find the ActiveControl Property topic.
- In the ActiveControl Property topic, click the Example hyperlink.
- Using your mouse, select any multiple-line portion of the code in the
example that excludes either the first or last lines of the code, or
both.
- Press Ctrl+C to copy the highlighted code.
- Paste the code into the Code Window in Visual Basic, or into another
application such as Notepad.
RESULT: Some of the line feeds are omitted. Using the ActiveControl
Property example, if you copy the second through the sixth lines the code
is formatted as follows:
If TypeOf Screen.ActiveControl Is TextBox Then
Label1.Caption = Screen.ActiveControl.Text Else
Label1.Caption = "Button: " + Screen.ActiveControl.Caption End If
The correct formatting is:
If TypeOf Screen.ActiveControl Is TextBox Then
Label1.Caption = Screen.ActiveControl.Text
Else
Label1.Caption = "Button: " + Screen.ActiveControl.Caption
End If
If you copy the entire code example, including the entire first and last
lines, the code is formatted as follows:
Private Sub Form_Click ()
If TypeOf Screen.ActiveControl Is TextBox Then
Label1.Caption = Screen.ActiveControl.Text
Else
Label1.Caption = "Button: " + Screen.ActiveControl.Caption
End If
End Sub
(c) Microsoft Corporation 1998, All Rights Reserved. Contributions by Jim
Saunders, Microsoft Corporation
Additional query words:
Keywords : kbHTMLHelp kbMSDN kbVBp600 kbVC600 kbVFp600 kbVJ600 kbVS600
Version : WINDOWS:6.0; winnt:6.0
Platform : WINDOWS winnt
Issue type : kbprb