Txt file with 1500 characters??

FranklinFranklin Member Posts: 253
Hi everybody,

I Need to create a txt file with a record of 1500 characters. When I create a variable of type text, only allows me to 1024. Can´t I do this?

There should be any way to solve that, right?

:-k :-k

EDIT: I think i can add two fields of 750 characters...

Comments

  • matttraxmatttrax Member Posts: 2,309
    Yes, you can split your text value across multiple variables. A Text Array is probably best suited for this.
  • MBergerMBerger Member Posts: 413
    Or use an outstream, that way you can write lines of any length you want. If you pass a value to the WriteText function of an outstream, it will append it to the existing file without adding a newline at the end. You can force a newline by calling the WriteText function without a value.

    The following sample is by no way complete, but will give you some pointers :

    variables :
    OutFile : file
    oStream : OutStream ;
    OutFile.writemode(true) ;
    OutFile.create(outfilename) ;
    OutFile.createoutstream(oStream) ;
    
    oStream.WriteText('this writes the text to the file') ;
    oStream.WriteText('this will NOT be a new line !') ;
    oStream.WriteText ; // forces new line
    
    outfile.close ;
    
  • FranklinFranklin Member Posts: 253
    Thanks!!

    I think i´ll try with WriteText function of an outstream... like MBerger says... although i´have never used it. :thumbsup:
Sign In or Register to comment.