Results 1 to 5 of 5

Thread: Limit length (lines) of text file

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2001
    Posts
    142
    I have an instant messenger program and that logs each users logs separatly. I need to these files to only allow so many lines so they dont grow out of conrtrol.
    Any examples on how this can be accompished?
    right now its just appending each entry.

    Any help is appriciated.
    thanks
    Garrett

  2. #2
    Fanatic Member ExtremePimpness's Avatar
    Join Date
    Jan 2001
    Location
    Indianapolis, Indana - USA
    Posts
    550
    you could have your program open it as input and then split it using the vbctlf as the delimiter and then get the ubound of the array that you assigned to the split function and subtract from it the number of entries that you want to include in the file then you loop through and write the entries from the array starting at the number you got from the subtraction to the ubound to the log.

    that should limit the lines that are stored in the data file if you don't understand my incesant rambling that is because i have been up for about 38 hours and i appoligize

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jan 2001
    Posts
    142

    hmmmmm

    not sure I understand.. im a begginer maybe an example would help? anyone?
    If I cant limit this im going to have to nix the log code

  4. #4
    Fanatic Member ExtremePimpness's Avatar
    Join Date
    Jan 2001
    Location
    Indianapolis, Indana - USA
    Posts
    550
    i'll see what i can do but i have to goto sleep so i will post it later tonight(ut us !0:38 Am here and i still havn't gone to bed

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jan 2001
    Posts
    142
    ok go get some sleep..
    anyone else have any ideas?

    here is a little more info on what I need.

    lets say I want to limit the length of the log file to 500 lines. after you reach 500, any lines you add at the top remove the bottom lines to keep it at 500.

    Thanks!

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