Welcome to Dream.In.Code
Getting VB Help is Easy!

Join 98,764 VB Programmers for FREE!. Ask your question and get quick answers from Dream.In.Code experts. There are 1,037 online right now! We're the #1 programming help community on the internet! Registration is fast and FREE... Join Now!

Chat LIVE With a VB Expert

Register to Make This Box Go Away!


sequential access file

 
Reply to this topicStart new topic

sequential access file, I need to figure out how to make it look better

mylifeishz
post 20 May, 2008 - 09:28 AM
Post #1


New D.I.C Head

*
Joined: 20 May, 2008
Posts: 9

Hi, I am sorry to bother you but I have tried several different things and I finally got my code fixed except for how it looks in my text file. My code looks like this:

CODE


' Project name:         Memo Project
' Project purpose:      The project writes the contents of a multiline text
'                       box to a sequential access file.
' Created/revised by:   <> on <>

Option Explicit On
Option Strict On

Public Class MainForm

    Private Sub MainForm_Load(ByVal sender As Object, _
    ByVal e As System.EventArgs) Handles Me.Load
        
    End Sub
    Private Sub exitButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles exitButton.Click
        Me.Close()
    End Sub

    Private Sub memoTextBox_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles memoTextBox.Enter
        memoTextBox.SelectAll()
    End Sub

    Private Sub writeButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles writeButton.Click
        Dim file As String = "C:\Course Technology\83623-0\VbReloaded\Chap09\Memo Solution\Memo Project\memo.txt"
        Dim Intro As String = "To all employees:"
        Dim Body As String = "The annual picnic will be held at Rogers Park on Saturday, July 13. Bring your family for a day full of fun!"
        Dim blank As String = ""
        Dim name As String = "Carolyn Meyer"
        Dim title As String = "Personnel Manager"
        My.Computer.FileSystem.WriteAllText(file, Intro, True)
        My.Computer.FileSystem.WriteAllText(file, Body, True)
        My.Computer.FileSystem.WriteAllText(file, blank, True)
        My.Computer.FileSystem.WriteAllText(file, name, True)
        My.Computer.FileSystem.WriteAllText(file, title, True)
    End Sub

End Class


I have almost everything done. I just need help in the way the information is displayed in my text file.

It is supposed to look like this:
To all employees:

The annual picnic will be held at Rogers Park on Saturday, July 13. Bring
your family for a day full of fun!

Carolyn Meyer
Personnel Manager

Instead it looks like this: To all employees:To all employees:The annual picnic will be held at Rogers Park on Saturday, July 13. Bring your family for a day full of fun!Carolyn MeyerPersonnel Manager

Does anyone know how to fix this?

This post has been edited by mylifeishz: 20 May, 2008 - 11:20 AM
User is offlineProfile CardPM

Go to the top of the page


mylifeishz
post 20 May, 2008 - 11:19 AM
Post #2


New D.I.C Head

*
Joined: 20 May, 2008
Posts: 9

Thanks for all the looks. I think I have it figured out finally. It must be kind of a hard topic as nobody was able to help, but thanks anyway. This site is wonderful!
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 7/20/08 02:35PM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month
-->