SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 19/12/2012, 09:00 PM   #1
NoaM[W]
Little Clucker
 
Join Date: Sep 2012
Posts: 19
Reputation: 0
Default File Functions + String Functions

Code:
        new string[255];
	new String[255];
	new File:example = fopen("input.txt", io_writeread);
	fwrite(example, "I just wrote here");
	fread(example, string);
	fclose(example);
	
	new File:example2 = fopen("output.txt", io_write);
	new stringLength = strlen(string);
        strmid(String,string,0,stringLength / 2);
	fwrite(example2,String);
	fclose(example2);
i want to write half of the sentence:
I just wrote here >> I just
NoaM[W] is offline   Reply With Quote
Old 19/12/2012, 09:06 PM   #2
LarzI
High-roller
 
LarzI's Avatar
 
Join Date: Apr 2007
Location: Norway
Posts: 2,628
Reputation: 136
Default Re: File Functions + String Functions

This isn't working? What exactly happens? Also, your string arrays are large. Do you really need 254 characters?
__________________


NEW: [FS] Simple Cellphones

if( strfind( title, "REP", true ) != -1 )
{________________________________________
Sigh();__________________________
}________________________________________


LarzI is offline   Reply With Quote
Old 19/12/2012, 09:13 PM   #3
NoaM[W]
Little Clucker
 
Join Date: Sep 2012
Posts: 19
Reputation: 0
Default Re : Re: File Functions + String Functions

Quote:
Originally Posted by LarzI View Post
This isn't working? What exactly happens? Also, your string arrays are large. Do you really need 254 characters?
input - "I just wrote here ` `O  8 h ׀"
output - " " (Empty)
NoaM[W] is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Include] [INC] LSF - Lorenc's Simple Functions (w/ gang/clan functions) Lorenc_ Includes 14 21/04/2018 05:06 AM
[Include] strlib - String functions! Slice Includes 58 23/08/2017 12:59 PM
Pawno functions Doesn't Show on the functions Tab silvan Scripting Help 2 11/11/2012 10:42 AM
[Tool/Web/Other] Cross Functions V1.0 - Create Custom Call Backs / Functions by Just 1 Click CROSS_Hunter Tools and Files 7 05/11/2012 03:17 PM


All times are GMT. The time now is 04:35 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.