Results 1 to 4 of 4

Thread: How to use enter char in SCAR?

  1. #1
    Join Date
    Mar 2007
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default How to use enter char in SCAR?

    Hi guys.

    I'm trying to write data to a file with certain format
    Here's my code

    SCAR Code:
    procedure WriteCardsDataToFile;
    var k : byte;
    begin
      // The location for the file we are creating.
      fileLocation := 'C:\data.txt';
      // Sets OutFile to Create a file and if it creates it successfully it returns
      // a file number. False because this file isn't being shared by any app.
      OutFile := ReWriteFile(fileLocation, False);
      // Write
      for k:=1 to 10 do
          if (k=8) then
              WriteFileString(OutFile, cardsFounds_Name[k] + ' ' + CHR(13))
          else
              WriteFileString(OutFile, cardsFounds_Name[k] + ' ');
      // Close the file OutFile.
      CloseFile(OutFile);
      // Writes a successful message since it worked!
      WriteLn('You''ve successfully created the file!');
    end;

    Now I'm pretty sure that CHR(13) is carriage return / ENTER or we can usually use /r/n to do that, but it seems doesn't work with SCAR...

    Anyone know how to add ENTER when writing to a file?
    Is there a function called WriteLnFileString ??

    Cheers

  2. #2
    Join Date
    Jan 2007
    Location
    Toronto.
    Posts
    150
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You have to use Wordpad to view the file because notepad displays those squares when SCAR writes to files.

  3. #3
    Join Date
    Mar 2007
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    hei you're right. lol.
    what a stupid mistake to not check it using wordpad/ms word

    now i'm going to do read from file

  4. #4
    Join Date
    May 2007
    Posts
    127
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    notepad =b
    you attempt to light a fire, you light the fire, you place the raw shrimp on the fire, you accidentally burn the shrimp. DAMMIT!

    Evil Walrus's will control the world someday...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Int to char casting?
    By Macro_FTW in forum OSR Help
    Replies: 2
    Last Post: 01-20-2009, 01:08 AM
  2. Char*, Char *, Char *var, Char var[] ... Me is confused...
    By Jason2gs in forum C/C++ Help and Tutorials
    Replies: 11
    Last Post: 04-17-2008, 02:56 PM
  3. Replies: 4
    Last Post: 05-15-2007, 01:42 AM

Posting Permissions

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