Log in

View Full Version : How to use enter char in SCAR?



asdqwe
05-28-2007, 03:07 AM
Hi guys.

I'm trying to write data to a file with certain format
Here's my 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 ?? :D

Cheers

NinjaTerrorist
05-28-2007, 03:10 AM
You have to use Wordpad to view the file because notepad displays those squares when SCAR writes to files.

asdqwe
05-28-2007, 03:57 AM
hei you're right. lol.
what a stupid mistake to not check it using wordpad/ms word :D

now i'm going to do read from file :)

evilwalrus
05-28-2007, 04:18 PM
notepad =b