AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Reading from two files. (https://forums.alliedmods.net/showthread.php?t=224237)

vamppa 08-21-2013 17:00

Reading from two files.
 
Hello

Am I able to open two files with fopen and read from them?
defining both with iz_File

PHP Code:

new sz_File[128], sz_FileII[128];
get_configsdir(sz_File,127);
format(sz_File,127,"Oke.ini",sz_File);
get_configsdir(s_FileII,127);
format(sz_FileII,127,"sexouZe.ini",sz_FileII);

new 
iz_File=fopen(sz_File,"rt") && ( sz_FileII,"rt"); 


YamiKaitou 08-21-2013 17:24

Re: Reading from two files.
 
Quote:

Originally Posted by vamppa (Post 2018936)
Hello

Hi

Quote:

Am I able to open two files with fopen and read from them?
Yes

Quote:

defining both with iz_File
No

vamppa 08-21-2013 17:27

Re: Reading from two files.
 
damn had an feeling that was the case.
alright other question.

Can I change the order it reads from one file?
- lets say the 1st time I want it to read from top - bottom
- 2nd time from bottom - top
- or 3rd time randomly

YamiKaitou 08-21-2013 17:47

Re: Reading from two files.
 
Quote:

Originally Posted by vamppa (Post 2018964)
Can I change the order it reads from one file?

Using fseek, yes


All times are GMT -4. The time now is 19:13.

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