Click here to Skip to main content
15,911,762 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Modal Forms in VB 6.0 Pin
Purple Monk16-Sep-04 0:43
Purple Monk16-Sep-04 0:43 
GeneralRe: Modal Forms in VB 6.0 Pin
pbpb16-Sep-04 2:21
pbpb16-Sep-04 2:21 
GeneralVisual Basic Sequential File IO Pin
Red Sunday15-Sep-04 4:50
Red Sunday15-Sep-04 4:50 
GeneralRe: Visual Basic Sequential File IO Pin
Anonymous15-Sep-04 6:31
Anonymous15-Sep-04 6:31 
GeneralRe: Visual Basic Sequential File IO Pin
Red Sunday15-Sep-04 7:12
Red Sunday15-Sep-04 7:12 
GeneralRe: Visual Basic Sequential File IO [EDITED] Pin
Dave Kreskowiak15-Sep-04 8:03
mveDave Kreskowiak15-Sep-04 8:03 
GeneralRe: Visual Basic Sequential File IO [EDITED] Pin
Red Sunday15-Sep-04 8:14
Red Sunday15-Sep-04 8:14 
GeneralRe: Visual Basic Sequential File IO [EDITED] Pin
Dave Kreskowiak15-Sep-04 9:01
mveDave Kreskowiak15-Sep-04 9:01 
OK. Then throw out EVERYTHING about namespaces and System, System.IO, File.Exists... EVERYTHING. VB.NET is a VERY different language from VB6 and none of this stuff applies to VB6.

Now, you'll have to use the FileSystemObject to see if the specified file exists. This will return either True or False, it doesn't throw any errors.
Set fs = CreateObject("Scripting.FileSystemObject")
If fs.FileExists("C:\myTestFile.txt") Then
    .
    . ' The file exists...
    .
Else
    .
    . ' The file doesn't exist...
    .
End If

To open a text file for sequential write, you'll use the Open statement (docs here[^]):
Open "C:\myTestFile.txt" For Output As #1
Print #1, "This is line 1"
Print #1, "This is line 2..."
Print #1, "This is line 3..."
Close #1



RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

GeneralReturning Integer value from a VB (NOT .Net) Command line application Pin
Jobby Joseph15-Sep-04 3:54
Jobby Joseph15-Sep-04 3:54 
GeneralRe: Returning Integer value from a VB (NOT .Net) Command line application Pin
Dave Kreskowiak15-Sep-04 4:22
mveDave Kreskowiak15-Sep-04 4:22 
GeneralRe: Returning Integer value from a VB (NOT .Net) Command line application Pin
Jobby Joseph15-Sep-04 4:37
Jobby Joseph15-Sep-04 4:37 
GeneralDropdownlist Pin
jr121415-Sep-04 2:53
jr121415-Sep-04 2:53 
GeneralRe: Dropdownlist Pin
Purple Monk16-Sep-04 1:27
Purple Monk16-Sep-04 1:27 
GeneralRe: Dropdownlist Pin
jr121416-Sep-04 3:56
jr121416-Sep-04 3:56 
Generalprinting contents behind scrollbar Pin
vjer00114-Sep-04 19:12
vjer00114-Sep-04 19:12 
GeneralAdjusting PictureBox contrast/brightness Pin
Jason2314-Sep-04 14:29
Jason2314-Sep-04 14:29 
GeneralRe: Adjusting PictureBox contrast/brightness Pin
Anonymous14-Sep-04 18:24
Anonymous14-Sep-04 18:24 
GeneralConnecting to Oracle database Pin
pathuknown14-Sep-04 10:49
pathuknown14-Sep-04 10:49 
GeneralRe: Connecting to Oracle database Pin
Anonymous14-Sep-04 18:30
Anonymous14-Sep-04 18:30 
General.NET and Integer, Long, and Short Pin
GregOsborne14-Sep-04 10:05
GregOsborne14-Sep-04 10:05 
GeneralRe: .NET and Integer, Long, and Short Pin
Charlie Williams14-Sep-04 10:26
Charlie Williams14-Sep-04 10:26 
GeneralRe: .NET and Integer, Long, and Short Pin
GregOsborne14-Sep-04 16:28
GregOsborne14-Sep-04 16:28 
GeneralRe: .NET and Integer, Long, and Short Pin
Charlie Williams14-Sep-04 17:38
Charlie Williams14-Sep-04 17:38 
GeneralRe: .NET and Integer, Long, and Short Pin
Greg Osborne21-Sep-04 10:10
Greg Osborne21-Sep-04 10:10 
GeneralGetIfTable and VB.NET Pin
andrew|14-Sep-04 5:46
andrew|14-Sep-04 5:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.