by Karl Belin (1 Submission)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sun 30th May 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)
This code is used for a basic "Save As" function for my text editor. The code does file validty varification and if the code is valid the file
API Declarations
Dim strText As String 'string for file text, could later be declared as an array
'for larger amounts of text
'get file name
strFileName = InputBox("File name:", "Save File")
'check file validity, create file if valid
If strFileName = "" Then
MsgBox "Improper file name."
Exit Sub
Else
'open file
Open VB.App.Path & "/" & strFileName For Output As #1
'write file
strText = txtText.Text
Print #1, strText
'close file
Close #1
End If
End Sub
No comments have been posted about This code is used for a basic Save As function for my text editor. The code does file validty var. Why not be the first to post a comment about This code is used for a basic Save As function for my text editor. The code does file validty var.