AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Using fgets/parse for files with different formats (https://forums.alliedmods.net/showthread.php?t=327146)

MaNaReaver 09-03-2020 09:01

Using fgets/parse for files with different formats
 
Hey AM,

I had two sorts of files with formats: [Mapname] and [Mapname] [Info]. I was trying to use fgets for this, and wanted to know whether fgets reads just a single line at a time, or can it skip to another line (as fgets detects a newline character) while reading the file? Should I use parse instead, and will parse read only one line at a time?

Best regards,
MaNaReaver.

Bugsy 09-03-2020 16:52

Re: Using fgets/parse for files with different formats
 
http://www.amxmodx.org/api/file/fgets

Use fgets to read the entire line and then parse when needed.

MaNaReaver 09-05-2020 19:15

Re: Using fgets/parse for files with different formats
 
Quote:

Originally Posted by Bugsy (Post 2716530)
http://www.amxmodx.org/api/file/fgets

Use fgets to read the entire line and then parse when needed.

Thanks Bugsy, I was unable to differentiate between the two, and now I understand :D


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

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