VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



This code is used for a basic Save As function for my text editor. The code does file validty var

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

Rate This code is used for a basic Save As function for my text editor. The code does file validty var




'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

Download this snippet    Add to My Saved Code

This code is used for a basic Save As function for my text editor. The code does file validty var Comments

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.

Post your comment

Subject:
Message:
0/1000 characters