Results 1 to 5 of 5

Thread: formatting a file using Print statement

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Location
    Calgary,Alberta, Canada
    Posts
    70

    Post

    i have a Text file that i am saving and i need to change the way it is saved

    eg name
    lastname
    address
    phoneNumber
    ect.....

    I would like to know how to save it something
    like this

    Name lastName
    address phonenumber
    with spaces inserted between tha name and last name
    I cannot find what i am looking for in the help section I don't want to save the form
    just the info in the textboxes to file so i can print off the info at a later date in a invoice style formatt
    regards Jessie

    ------------------
    IF YOUR GONNA BE A BEAR
    BE A GRIZZLY

    [This message has been edited by Jessie (edited 12-04-1999).]

  2. #2
    Junior Member
    Join Date
    Dec 1999
    Location
    houston,tx
    Posts
    20

    Post

    Jessie:

    Go like this:

    Open "c:\directory\filename.out" for output as #1

    Print #1, Name, lastName
    Print #1, Adress, Phonenumber

    Close #1

    Good luck!


  3. #3

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Location
    Calgary,Alberta, Canada
    Posts
    70

    Post

    thxs for your reply leif-p but i knew that already The part i wanted to know was how to
    put spaces inbetween the firstname and last name is their any other way other than using
    chr(9) I need to put this several times to
    do the task that i want

  4. #4
    New Member
    Join Date
    Sep 1999
    Location
    Boise, ID USA
    Posts
    15

    Post

    Well if you are ever going to need to load the data into something again (and it sounds like you are...sounds like you are creating some sort of address book) then you are going to want to use the Write command, not the Print. Read up on it. It can make your life easier.

    You were saying something about using Chr(9) for something...if you want to put tabs in between the entries then you can do something like this:

    For counter= 1 to HowManyTabsYouWant
    TabString=TabString & Chr(9)
    Next counter

    Then:

    Print #1, FirstName, TabString, LastName

    Any other questions? You can email me at [email protected].

    -Adam

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Location
    Calgary,Alberta, Canada
    Posts
    70

    Post

    thxs for your reply addict i ended up using the "tabs()" after all but did not need to use a index to do it because each file will be a seperate input

    regards jessie

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width