### Setup.lst Section for Optional Help Files
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa733687%28v%3Dvs.60%29
This is an example of a section within the Setup.lst file that defines the files to be installed for an optional help feature. It specifies file names, destination paths, and other metadata required for the installation process.
```ini
[Help]
File1=MyApp.HL1,MyApp.HLP,$(AppPath),,,10/12/96,2946967,0.0.0
```
--------------------------------
### Setup1 Files Section Example
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa263457%28v%3Dvs.60%29
This section lists additional files required by the application, such as executables, data, and dependencies. These files are installed after the core files.
```INI
[Setup1 Files]
File1=@LotsAControls.exe,$(AppPath),$(EXESelfRegister),,1/26/98 3:43:48 PM,7168,1.0.0.0
File2=@mscomctl.ocx,$(AppPath),$(DLLSelfRegister),,1/23/98 9:43:40 AM,1011472,6.0.80.23
```
--------------------------------
### IconGroups Section Example
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa263457%28v%3Dvs.60%29
This section defines the Start menu program groups created during installation. Each group listed here is further detailed in its own subsection.
```INI
[IconGroups]
Group0=MyTestEXE
Group1=Group1
[MyTestExe]
Icon1=my.exe
Title1=MyTestExe
[Group1]
Icon1=ReadMe.txt
Title1=ReadMe
Icon2=my.hlp
Title2=Help
```
--------------------------------
### Base URL for Starting a Webclass Application
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa733549%28v%3Dvs.60%29
This is an example of a base URL used to initiate the Start event for a Visual Basic webclass application.
```text
http://www.mycompany-inc-10.com/Project1_OrderEntry.asp
```
--------------------------------
### Add Optional Help File Installation Prompt
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa733687%28v%3Dvs.60%29
This code snippet demonstrates how to add a dialog box to the setup program to ask the user if they want to install optional help files. It uses MsgBox for user interaction and conditional logic to proceed with disk space calculation and file copying.
```vb
Dim LoadHelp As Integer
LoadHelp = MsgBox ("Do you want to install Help? ", vbYesNo)
If LoadHelp = vbYes Then
CalcDiskSpace "Help"
EndIf
' Block of code containing cIcons = CountIcons(strINI FILES)
If LoadHelp = vbYes Then
cIcons = CountIcons("Help")
EndIf
' Block of code containing CopySection strINI_FILES.
If LoadHelp = vbYes Then
CopySection "Help"
EndIf
' Block of code containing CreateIcons, strINI FILES, strGroupName
```
--------------------------------
### Folder and FileSystemObject Manipulation Example
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa263345%28v%3Dvs.60%29
This example demonstrates creating, deleting, and retrieving information about folders using the FileSystemObject and Folder objects. It shows how to get parent folder names, drive information, and check if a folder is a root folder.
```vb
Private Sub Command10_Click()
' Get instance of FileSystemObject.
Dim fso As New FileSystemObject, fldr As Folder, s As String
' Get Drive object.
Set fldr = fso.GetFolder("c:")
' Print parent folder name.
Debug.Print "Parent folder name is: " & fldr
' Print drive name.
Debug.Print "Contained on drive " & fldr.Drive
' Print root file name.
If fldr.IsRootFolder = True Then
Debug.Print "This folder is a root folder."
Else
Debug.Print "This folder isn't a root folder."
End If
' Create a new folder with the FileSystemObject object.
fso.CreateFolder ("c:\Bogus")
Debug.Print "Created folder C:\Bogus"
' Print the base name of the folder.
Debug.Print "Basename = " & fso.GetBaseName("c:\bogus")
' Get rid of the newly-created folder.
fso.DeleteFolder ("c:\Bogus")
Debug.Print "Deleted folder C:\Bogus"
End Sub
```
--------------------------------
### URL to Launch a Specific Webitem
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa733549%28v%3Dvs.60%29
This example shows a URL that bypasses the Start event and directly launches a specified webitem within a webclass application.
```text
http://www.mycompany-inc-10.com/Project1_OrderEntry.asp?WCI=Form1
```
--------------------------------
### Demonstrate ShortName Property
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa265859%28v%3Dvs.60%29
Illustrates how to use the ShortName property to get the 8.3 short name of a file. This example requires a valid file path as input.
```vb
Sub ShowShortName(filespec)
Dim fs, f, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile(filespec)
s = "The short name for " & "" & UCase(f.Name)
s = s & "" & vbCrLf
s = s & "is: " & "" & f.ShortName & ""
MsgBox s, 0, "Short Name Info"
End Sub
```
--------------------------------
### Running Code Examples from Help
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa733522%28v%3Dvs.60%29
This procedure outlines how to copy and run code examples from Visual Basic Help. It is intended for code examples that do not contain public declarations.
```Visual Basic
Sub ExampleProcedure()
' Code example goes here
End Sub
```
--------------------------------
### Installing Program Files
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa716238%28v%3Dvs.60%29
Illustrates how to write program-specific files to the application directory specified by the user during installation. Defaults to the \Program Files directory.
```vb
Code in Setup1.vbp demonstrates how to write files to this location.
```
--------------------------------
### StartProject Property
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa263187%28v%3Dvs.60%29
Returns or sets the project that will start when the user selects 'Start' from the 'Run' menu, or presses the F5 key.
```APIDOC
## StartProject Property
### Description
Returns or sets the project that will start when the user selects **Start** from the **Run** menu, or presses the F5 key.
### Syntax
`_object_.StartProject`
### Parameters
#### Object
- **_object_**: An object expression that evaluates to an object in the Applies To list.
```
--------------------------------
### Example .ddf File for Package and Deployment Wizard
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa261342%28v%3Dvs.60%29
This .ddf file example, generated by the Package and Deployment Wizard, includes settings for cabinet creation and lists the files to be included.
```ddf
.OPTION EXPLICIT
.Set Cabinet=on
.Set Compress=on
.Set MaxDiskSize=CDROM
.Set ReservePerCabinetSize=6144
.Set DiskDirectoryTemplate=
.Set CompressionType=MSZIP
.Set CompressionLevel=7
.Set CompressionMemory=21
.Set CabinetNameTemplate="ControlDemo.cab"
"C:\Website\Cabfiles\ControlDemo.inf"
"C:\ControlDemo\ControlDemo.ocx"
```
--------------------------------
### Example Command-Line Input
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa733562%28v%3Dvs.60%29
This shows an example of how a user might enter command-line arguments in the Run dialog box for an alarm clock application.
```text
Alarm 11:00:00
```
--------------------------------
### Get Available Drive Space
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa242868%28v%3Dvs.60%29
This example demonstrates how to use the AvailableSpace property to display the available space on a specified drive. It requires creating a FileSystemObject and a Drive object.
```vbscript
Sub ShowAvailableSpace(drvPath)
Dim fs, d, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set d = fs.GetDrive(fs.GetDriveName(drvPath))
s = "Drive " & UCase(drvPath) & " - "
s = s & d.VolumeName & vbCrLf
s = s & "Available Space: " & FormatNumber(d.AvailableSpace/1024, 0)
s = s & " Kbytes"
MsgBox s
End Sub
```
--------------------------------
### Get Drive Space Information
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa243202%28v%3Dvs.60%29
This example demonstrates how to use the TotalSize property along with other FileSystemObject methods to display the total size and available space of a drive in kilobytes. It requires the creation of a FileSystemObject.
```vbscript
Sub ShowSpaceInfo(drvpath)
Dim fs, d, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set d = fs.GetDrive(fs.GetDriveName(fs.GetAbsolutePathName(drvpath)))
s = "Drive " & d.DriveLetter & ":"
s = s & vbCrLf
s = s & "Total Size: " & FormatNumber(d.TotalSize/1024, 0) & " Kbytes"
s = s & vbCrLf
s = s & "Available: " & FormatNumber(d.AvailableSpace/1024, 0) & " Kbytes"
MsgBox s
End Sub
```
--------------------------------
### Start HTML Page and Table
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa232739%28v%3Dvs.60%29
Use Response.Write to begin generating an HTML page. This includes the main heading and the start of an HTML table with a border and specified width.
```vb
Response.Write "
Customers in the System
"
```
--------------------------------
### Webclass Base URL Example
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa733726%28v%3Dvs.60%29
This example shows the base URL for a webclass named CustomerInquiry within a project named Project1, hosted on www.mycompany-inc-10.com and stored in the CustomerSupport directory.
```url
http://www.mycompany-inc-10.com/CustomerSupport/
Project1_CustomerInquiry.asp
```
--------------------------------
### Example BootStrap Files Section Entries
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa263457%28v%3Dvs.60%29
This snippet shows typical entries for the BootStrap Files section of a Setup.lst file, listing core Visual Basic runtime files.
```text
[Bootstrap Files]
File1=@Msvbvm60.dll,$(WinSysPathSysFile),$(DLLSelfRegister),1/23/98 9:43:25 AM,1457936,6.0.80.23
File2=@OleAut32.dll,$(WinSysPath),$(DLLSelfRegister),1/21/98 11:08:26 PM,571152,2.30.4248.1
File3=@OlePro32.dll,$(WinSysPathSysFile),$(DLLSelfRegister),1/21/98 11:08:27 PM,152336,5.0.4248.1
```
--------------------------------
### Get Folder Size in VBA
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa243182%28v%3Dvs.60%29
Illustrates how to use the Size property to display the total size of a folder and its contents in bytes. This example requires the FileSystemObject.
```vb
Sub ShowFolderSize(filespec)
Dim fs, f, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(filespec)
s = UCase(f.Name) & " uses " & f.size & " bytes."
MsgBox s, 0, "Folder Size Info"
End Sub
```
--------------------------------
### Setup.lst File Format for Files
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa262320%28v%3Dvs.60%29
Defines the standard format for listing files in the Bootstrap and Setup1 Files sections of a Setup.lst file. Each line specifies file details for installation.
```text
Filex= file,install,path,register,shared,date,size[,version]
```
--------------------------------
### Get an Existing File Object
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa716288%28v%3Dvs.60%29
Access an existing file using the GetFile method of the FileSystemObject. This example demonstrates how to obtain a File object for a specific path.
```vb
Dim fso As New FileSystemObject, fil As File
Set fil = fso.GetFile("c:\test.txt")
```
--------------------------------
### Get Number of Entries in Combo Box
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa240832%28v%3Dvs.60%29
Use the ListCount property to retrieve the total number of items in a combo box. This example displays the count in a text box.
```vb
Text1.Text = "You have " & Combo1.ListCount & " _
entries listed"
```
--------------------------------
### ShowHelp Method
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa259371%28v%3Dvs.60%29
Runs Winhlp32.exe and displays the Help file you specify. Before using this method, ensure the HelpFile and HelpCommand properties of the CommonDialog control are set appropriately.
```APIDOC
## ShowHelp Method
### Description
Runs Winhlp32.exe to display a specified Help file. Requires prior configuration of the `HelpFile` and `HelpCommand` properties of the `CommonDialog` control.
### Method
Not applicable (this is a method call on a control object).
### Object
`CommonDialog` control
### Syntax
_object_.ShowHelp
### Remarks
Before using the `ShowHelp` method, you must set the `HelpFile` and `HelpCommand` properties of the `CommonDialog` control to one of their appropriate constants or values. Otherwise, Winhlp32.exe doesn't display the Help file.
### Applies To
CommonDialog control
```
--------------------------------
### Moving, Copying, and Deleting Files
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa263346%28v%3Dvs.60%29
This example shows how to create a text file, write to it, move it to a different directory, copy it, and then delete the original and copied files using FileSystemObject methods.
```vb
Sub Manip_Files()
Dim fso as New FileSystemObject, txtfile, fil1, fil2
Set txtfile = fso.CreateTextFile("c:\testfile.txt", True)
MsgBox "Writing file"
' Write a line.
txtfile.Write ("This is a test.")
' Close the file to writing.
txtfile.Close
MsgBox "Moving file to c:\tmp"
' Get a handle to the file in root of C:\.
Set fil1 = fso.GetFile("c:\testfile.txt")
' Move the file to \tmp directory.
fil1.Move ("c:\tmp\testfile.txt")
MsgBox "Copying file to c:\temp"
' Copy the file to \temp.
fil1.Copy ("c:\temp\testfile.txt")
MsgBox "Deleting files"
' Get handles to files' current location.
Set fil1 = fso.GetFile("c:\tmp\testfile.txt")
Set fil2 = fso.GetFile("c:\temp\testfile.txt")
' Delete the files.
fil1.Delete
fil2.Delete
MsgBox "All done!"
End Sub
```
--------------------------------
### Declare _lopen with Alias for Nonstandard Name
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa716201%28v%3Dvs.60%29
Use the Alias clause to call DLL procedures with nonstandard names, such as those starting with an underscore. This example declares the _lopen function from kernel32.dll.
```vb
Declare Function lopen Lib "kernel32" Alias "_lopen" _
(ByVal lpPathName As String, ByVal iReadWrite _
As Long) As Long
```
--------------------------------
### Example SQL with Parameters
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa242103%28v%3Dvs.60%29
This SQL statement demonstrates the use of parameter markers ('?') for input values, which are then defined in the Parameters tab of the Query Property Page.
```sql
SELECT * FROM authors WHERE state = ? AND zip = ?
```
--------------------------------
### Read-Write Property Example
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa716315%28v%3Dvs.60%29
This code fragment demonstrates a typical read-write property in Visual Basic, including private storage and public Property Get and Property Let procedures.
```Visual Basic
' Private storage for property value.
Private mintNumberOfTeeth As Integer
Public Property Get NumberOfTeeth() As Integer
NumberOfTeeth = mintNumberOfTeeth
End Property
Public Property Let NumberOfTeeth(ByVal NewValue _
As Integer)
' (Code to validate property value omitted.)
mintNumberOfTeeth = NewValue
End Property
```
--------------------------------
### Setting Default String Type
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa263421%28v%3Dvs.60%29
This example demonstrates how to set the default data type for variables starting with letters A through Q to String. The variable 'Message' will be treated as a string.
```vb
DefStr A-Q
. . .
Message = "Out of stack space."
```
--------------------------------
### Visual Basic Project File (.vbp) Example
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa716294%28v%3Dvs.60%29
This snippet shows a typical .vbp file structure, including project type, forms, modules, classes, and compilation settings. Entries are added as project elements and options are configured.
```vb
Type=Exe
Form=B_Form.frm
Reference=*
{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\WINDOWS\SYSTEM\STDOLE2.TLB#OLE Automation
Form=A_Form.frm
Module=CModule; C_Module.bas
Class=DClass; D_Class.cls
Startup="BForm"
Command32=""
Name="Project1"
HelpContextID="0"
CompatibleMode="0"
MajorVer=1
MinorVer=0
RevisionVer=0
AutoIncrementVer=0
ServerSupportFiles=0
VersionCompanyName="Microsoft"
CompilationType=0
OptimizationType=0
FavorPentiumPro(tm)=0
CodeViewDebugInfo=0
NoAliasing=0
BoundsCheck=0
OverflowCheck=0
FlPointCheck=0
FDIVCheck=0
UnroundedFP=0
StartMode=0
Unattended=0
ThreadPerObject=0
MaxNumberOfThreads=1
```
--------------------------------
### Create a New Folder and Access its Properties
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa716288%28v%3Dvs.60%29
This example shows how to create a new folder using CreateFolder and then immediately access its properties, such as Name, without needing a separate GetFolder call.
```vb
Private Sub Create_Folder()
Dim fso As New FileSystemObject, fldr As Folder
Set fldr = fso.CreateFolder("C:\MyTest")
MsgBox "Created folder: " & fldr.Name
End Sub
```
--------------------------------
### Accessing an ActiveX Document in Internet Explorer
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa733610%28v%3Dvs.60%29
This example shows the URL format to access a compiled ActiveX document from Internet Explorer. The path will vary based on your Visual Basic installation directory.
```html
file://c:\Program Files\VB\DocObject1.vbd
```
--------------------------------
### Calculate Days Left in Year
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa261347%28v%3Dvs.60%29
This snippet calculates the remaining days in the year based on the current date and time. It uses Now to get the current date/time and DateSerial to determine the start of the next year.
```vb
Private Sub Form_Click ()
Dim rightnow, daysleft, hoursleft, minutesleft
rightnow = Now ' Now returns the current date/time.
daysleft = Int(DateSerial(Year(rightnow) _
+ 1, 1, 1) - rightnow)
hoursleft = 24 - Hour(rightnow)
minutesleft = 60 - Minute(rightnow)
Print daysleft & " days left in the year."
Print hoursleft & " hours left in the day."
Print minutesleft & " minutes left in the hour."
End Sub
```
--------------------------------
### Print Multiple Lines Using Separate Print Statements
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa240831%28v%3Dvs.60%29
By default, each Print method call starts a new line. This example shows how multiple Print statements result in separate lines of output.
```vb
picLineCount.Print "This is line 1."
picLineCount.Print "This is line 2."
```
--------------------------------
### String Comparison Output (Binary)
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa242117%28v%3Dvs.60%29
Example output when comparing 'printer' and 'Screen' using the default Binary comparison method.
```text
'Screen' comes before 'printer'
```
--------------------------------
### Processing a Subset of the Second Result Set
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa716283%28v%3Dvs.60%29
Process rows from the second result set based on a condition. This example adds names to a ListBox until a name starting with 'B' is encountered. It then prepares to activate the next result set.
```vb6
' Loop through some rows.
Do While Not MyRs.EOF and MyRs(0) < "B"
' Use the first column.
NameList1.AddItem = MyRs(0)
MyRs.MoveNext
Loop
' Activate the next set of results
' and discard remaining rows.
If (MyRs.MoreResults) Then ...
```
--------------------------------
### Object Initialization and Termination Logging
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa263491%28v%3Dvs.60%29
This code demonstrates how to log object initialization and termination using the global debug collection. Replace 'Product' with your class name. Include this in each class module.
```vb
' Storage for the debug ID.
Private mlngDebugID As Long
Property Get DebugID() As Long
DebugID = mlngDebugID
End Property
Private Sub Class_Initialize()
mlngDebugID = DebugSerial
' Add a string entry to the global collection.
gcolDebug.Add "Product Initialize; DebugID=" _
& DebugID, CStr(DebugID)
End Sub
Private Sub Class_Terminate()
' Remove the string entry, so you know the object
' isn't around any more.
gcolDebug.Remove CStr(DebugID)
End Sub
```
--------------------------------
### Get Private Profile String Example
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa241761%28v%3Dvs.60%29
This code snippet demonstrates how to retrieve a string from a private profile (INI) file using the GetPrivateProfileString API function. It correctly handles the buffer size and extracts the null-terminated string.
```vb
buffer = String(145, Chr(" "))
ret = GetPrivateProfileString(section, _
entry, default, buffer, Len(buffer)-1, filename)
retstring = Left(buffer, Instr(buffer, Chr(0))-1))
```
--------------------------------
### Provide Root Object Reference via Property Get
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa261362%28v%3Dvs.60%29
This example demonstrates how to provide access to a root object from a public creatable object, such as a Connector or Globals object. It returns a global reference to the root object without creating circular references.
```vb
Property Get Root() As Root
Set Root = gRoot
End Property
```
--------------------------------
### SelLength, SelStart, SelText Properties
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa443239%28v%3Dvs.60%29
These properties allow you to get or set the length of selected characters, the starting point of selected text, and the string containing the currently selected text within ActiveX controls like ComboBox and TextBox. They are not available at design time.
```APIDOC
## SelLength, SelStart, SelText Properties (ActiveX Controls)
### Description
- **SelLength**: Returns or sets the number of characters selected.
- **SelStart**: Returns or sets the starting point of text selected; indicates the position of the insertion point if no text is selected.
- **SelText**: Returns or sets the string containing the currently selected text; consists of a zero-length string ("" if no characters are selected.
These properties aren't available at design time.
### Syntax
`object.SelLength [= number]`
`object.SelStart [= index]`
`object.SelText [= value]`
### Parameters
#### Object
- `object`: An object expression that evaluates to an object in the Applies To list (e.g., a ComboBox or TextBox control).
#### Settings
- `number`: A numeric expression specifying the number of characters selected. Valid range is 0 to the total number of characters in the edit area of a ComboBox or TextBox control.
- `index`: A numeric expression specifying the starting point of the selected text.
- `value`: A string expression containing the selected text.
### Remarks
Use these properties for tasks such as setting the insertion point, establishing an insertion range, selecting substrings in a control, or clearing text. Used in conjunction with the Clipboard object, these properties are useful for copy, cut, and paste operations.
When working with these properties:
- Setting **SelLength** less than 0 causes a run-time error.
- Setting **SelStart** greater than the text length sets the property to the existing text length; changing **SelStart** changes the selection to an insertion point and sets **SelLength** to 0.
- Setting **SelText** to a new value sets **SelLength** to 0 and replaces the selected text with the new string.
```
--------------------------------
### HTML Hyperlink Example
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa241672%28v%3Dvs.60%29
This is an example of a standard HTML hyperlink.
```html
Go to Microsoft
```
--------------------------------
### Start Visual Basic in SDI Environment
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa231236%28v%3Dvs.60%29
Use the /sdi switch to launch Visual Basic with the Single Document Interface (SDI) programming environment.
```bash
/sdi
```
--------------------------------
### SelLength, SelStart, SelText Property Syntax
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa443239%28v%3Dvs.60%29
Illustrates the basic syntax for using the SelLength, SelStart, and SelText properties with an object.
```VB
object.SelLength [= number]
object.SelStart [= index]
object.SelText [= value]
```
--------------------------------
### Example URL in Webclass
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa241747%28v%3Dvs.60%29
This is an example of a URL embedded within a webclass response.
```vb
WCI=webitem1?WCE=event1
```
--------------------------------
### Basic HTML Template
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa263541%28v%3Dvs.60%29
An example of an HTML template file before adding replacement tags.
```html
Thank you for your order. We estimate that your order will be shipped on the following date: xxx.
```
--------------------------------
### Create a TCP Server
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa733709%28v%3Dvs.60%29
This code sets up a TCP server by defining the local port and listening for incoming connections. It handles connection requests and data arrival.
```vb6
Private Sub Form_Load()
' Set the LocalPort property to an integer.
' Then invoke the Listen method.
tcpServer.LocalPort = 1001
tcpServer.Listen
frmClient.Show ' Show the client form.
End Sub
Private Sub tcpServer_ConnectionRequest _
(ByVal requestID As Long)
' Check if the control's State is closed. If not,
' close the connection before accepting the new
' connection.
If tcpServer.State <> sckClosed Then _
tcpServer.Close
' Accept the request with the requestID
' parameter.
tcpServer.Accept requestID
End Sub
Private Sub txtSendData_Change()
' The TextBox control named txtSendData
' contains the data to be sent. Whenever the user
' types into the textbox, the string is sent
' using the SendData method.
tcpServer.SendData txtSendData.Text
End Sub
Private Sub tcpServer_DataArrival _
(ByVal bytesTotal As Long)
' Declare a variable for the incoming data.
' Invoke the GetData method and set the Text
' property of a TextBox named txtOutput to
' the data.
Dim strData As String
tcpServer.GetData strData
txtOutput.Text = strData
End Sub
```
--------------------------------
### Checkbox Naming Convention Example
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa241096%28v%3Dvs.60%29
Example of a descriptive name for a Check Box control using a prefix.
```vb
chkReadOnly
```
--------------------------------
### HTML Heading Element Example
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa241750%28v%3Dvs.60%29
This is an example of a standard HTML heading element with an ID attribute, which makes it programmable.
```html
My Heading
```
--------------------------------
### Load API File from Command Line
Source: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/aa261280%28v%3Dvs.60%29
Use this syntax to automatically load a text or database file when starting API Viewer. Ensure there is a space between the /T or /D argument and the filename.
```command-line
Apilod32.exe {/T|/D} filename
```