Author Topic: Function ReadLine(FileName: String; Line: Integer): String;  (Read 1267 times)

0 Members and 1 Guest are viewing this topic.

Offline squiddy

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 333
  • Flagger assassin
    • SoldatX
Script Name: Function ReadLine
Script Description Function that returns a single line from any file
Author: Squiddy
Compile Test: Passed
Core Version: 2.6.5
Hosted by: Soldat Central - http://soldatcentral.com/

Full Description:
Function ReadLine(FileName: String; Line: Integer): String;

This function reads a single line from a file.

Usage: ReadLine(FileName,Line);

Assuming, for exemple, you have the following lines in the file
Squiddy.txt:

"Squiddy is an awesome
scripter, who is simply
amazing. I love him."

ReadLine('Squiddy.txt',1) = 'Squiddy is an awesome'
ReadLine('Squiddy.txt',3) = 'amazing. I love him.'

If you are going to use it, then credit it.



(Size 931 B)
- http://soldatcentral.com/index.php?page=script&f=202 -


** Script hosted by Soldat Central! Please visit the author's script page and Rate this script **
www.soldatx.com.br - The brazilian Soldat community.

Offline Gizd

  • Flagrunner
  • ****
  • Posts: 586
  • (Re)tired
    • Eat-this! community site
Re: Function ReadLine(FileName: String; Line: Integer): String;
« Reply #1 on: June 19, 2010, 11:42:09 am »
Code: [Select]
GetPiece(ReadFile('Squiddy.txt'),#13+#10,N); //or #10+#13, can't remember the order

Offline kosik231

  • Major
  • *
  • Posts: 70
  • Where can I find Your soul?
Re: Function ReadLine(FileName: String; Line: Integer): String;
« Reply #2 on: June 19, 2010, 12:05:53 pm »
nice! i think ill use that for my scripts soon :D " Squiddy is an awesome
scripter " xD
For signatures, you are allowed only one image in your signature which may not be wider and taller than 300 and 125 pixels, and may not be over 20kB in file size. No BMPs are allowed.