SA-MP Forums Archive
File Functions + String Functions - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: File Functions + String Functions (/showthread.php?tid=400683)



File Functions + String Functions - NoaM[W] - 19.12.2012

Код:
        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


Re: File Functions + String Functions - LarzI - 19.12.2012

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


Re : Re: File Functions + String Functions - NoaM[W] - 19.12.2012

Quote:
Originally Posted by LarzI
Посмотреть сообщение
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)