VB School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a VB Expert!

Join 300,574 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 2,194 people online right now. Registration is fast and FREE... Join Now!




sequential access file

 

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

mylifeishz

20 May, 2008 - 08:28 AM
Post #1

New D.I.C Head
*

Joined: 20 May, 2008
Posts: 31


My Contributions
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 - 10:20 AM

User is offlineProfile CardPM
+Quote Post


mylifeishz

RE: Sequential Access File

20 May, 2008 - 10:19 AM
Post #2

New D.I.C Head
*

Joined: 20 May, 2008
Posts: 31


My Contributions
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
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/8/09 08:14AM

Live VB Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month