Results 1 to 4 of 4

Thread: ~Writing to a file... I'm lost for some reason~

  1. #1

    Thread Starter
    Hyperactive Member tomcatexodus's Avatar
    Join Date
    Feb 2001
    Posts
    372

    Talking ~Writing to a file... I'm lost for some reason~

    Hey there everyone, long time no post...

    I have a simple one here, (simple as far as I can tell)

    I want to write (print) to a file, so far I have simply;

    Code:
    OPEN "\LOGFILE.LOG" FOR APPEND AS #1
    DO
        '...bunch of stuff done here
        PRINT #1, CHR(ASCIICHAR)
    LOOP
    This repeats several times over and over throughout the execution, and the file is afterwards structured as thus;

    H
    i

    t
    h
    e
    r
    e

    This is a problem, and I would much rather the characters be sequenced horizontally without the line jump between each...

    I dont know how I can get around this, any ideas would be GRRRRREATLY appreciated

    Thanks

  2. #2
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    LOL!

    Interesting code, but overkill.

    Here's a better way...

    VB Code:
    1. Dim bytAry() as Byte
    2. ReDim bytAry(how_big_you_need it)
    3. 'do your loop on the bytary indices, this should be faster anyway
    4.  
    5. Open "\LOGFILE.LOG" For Binary As #1 '*cough* freefile -.-
    6. Put #1, ,bytAry()
    7. Close #1

  3. #3
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    To answer the original question, put a semicolon at the end of the line:

    print #1,"Hello"; '<-- no linebreak
    print #1," World" '<--- puts a line break at the end.
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  4. #4
    KING BODWAD XXI BodwadUK's Avatar
    Join Date
    Aug 2002
    Location
    Nottingham
    Posts
    2,176
    or just

    write #1, strdata

    If you dribble then you are as mad as me

    Lost World Creations Website (XBOX Indie games)
    Lene Marlin

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