AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to add a ; before a line in a file... (https://forums.alliedmods.net/showthread.php?t=55741)

SweatyBanana 05-28-2007 16:53

How to add a ; before a line in a file...
 
Anybody care to share the best method?

Lee 05-28-2007 17:12

Re: How to add a ; before a line in a file...
 
Open the file in your choice of text editor and press the ; key while the cursor is placed at the beginning of the line.

_Master_ 05-28-2007 17:17

Re: How to add a ; before a line in a file...
 
LOL. Best. Scripting Help. Ever

Brad 05-28-2007 18:03

Re: How to add a ; before a line in a file...
 
Read the line in, use either format() or add(), then write the line back out.

SweatyBanana 05-28-2007 19:35

Re: How to add a ; before a line in a file...
 
Something like this?

PHP Code:

copy(copied_line,511,text)
format(copied_line,511,";")
replace(text511textcopied_line)
write_file(filetextline 1


pRED* 05-28-2007 19:43

Re: How to add a ; before a line in a file...
 
how about just

Code:
format(line,511,";%s",line)

_Master_ 05-28-2007 19:43

Re: How to add a ; before a line in a file...
 
PHP Code:

read_file(fileline_notext[1], 510len)
text[0] = ';'
write_file(filetextline_no 1


SweatyBanana 05-28-2007 20:08

Re: How to add a ; before a line in a file...
 
Quote:

Originally Posted by pRED* | NZ (Post 483111)
how about just

Code:
format(line,511,";%s",line)

Thanks.

slmclarengt 05-28-2007 22:03

Re: How to add a ; before a line in a file...
 
Quote:

Originally Posted by SweatyBanana (Post 483122)
Thanks.

I foresee very good use of this to disable a plugin permanently just by pausing it once then adding a semi-colon in front of that specific plugin filename, but hey, that's just me :-).

Slmclarengt


All times are GMT -4. The time now is 10:41.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.