AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   #define MAX_SIZE 1012 (https://forums.alliedmods.net/showthread.php?t=131584)

moty_p 07-06-2010 17:48

#define MAX_SIZE 1012
 
why the max size can be biger in 1012?
how can i read biger files? (7KB)

Drak 07-06-2010 20:37

Re: #define MAX_SIZE 1012
 
What are you talking about. Where is that defined?

Alucard^ 07-06-2010 23:05

Re: #define MAX_SIZE 1012
 
Doesn't exist something known as "#define MAX_SIZE 1012", that just a defines called MAX_SIZE with value 1012 defined for the author of the plugin... you know what is a define in pawn languages?

Also, you should add more description cuz i really don't understand what you want to do... biger file? for what? i don't know what are you talking about.

moty_p 07-07-2010 02:54

Re: #define MAX_SIZE 1012
 
this is my code:

#define MAX_SIZE 1012

new g_Text[MAX_SIZE]
new gamemp[34]

public Read_MpGame()
{
new i_File, s_File[128], Len, i
get_configsdir(s_File, charsmax(s_File))
format(s_File, charsmax(s_File), "%s/gamemp.txt", s_File)
i_File = fopen(s_File, "r")
fgets(i_File, g_Text, MAX_SIZE)
fclose(i_File)
md5_file(s_File, gamemp)
Len = strlen(gamemp)
for (i = 4; i < Len-1; i++) gamemp[i] = 0
}
this is work if the MAX_SIZE is not biger from 1012 and i need to work wiht 5000
if i change the line
#define MAX_SIZE 1012
to
#define MAX_SIZE 5000
is not work

Drak 07-07-2010 13:10

Re: #define MAX_SIZE 1012
 
You're only getting the first line.
Code:
    while(!feof(i_File))         fgets(i_File, g_Text, MAX_SIZE)

pankiller6 07-07-2010 18:17

Re: #define MAX_SIZE 1012
 
I have the same problem, i need more than 1kb

fysiks 07-07-2010 18:46

Re: #define MAX_SIZE 1012
 
Quote:

Originally Posted by Drak (Post 1231036)
You're only getting the first line.
Code:
    while(!feof(i_File))         fgets(i_File, g_Text, MAX_SIZE)

Clarification:
fgets() will only get a single line at a time. So, without a while loop you are only getting the first line.


All times are GMT -4. The time now is 07:06.

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