Loop an enum
#1

Hey.
I'm trying to loop through an enum. The problem is, I can't do it correctly because I've a string + integer.
My enum:
PHP код:
enum E_FACTION_INFOS
{
    
fSQLID,
    
fName[MAX_FAC_RANK_NAME],
    
fDiminutive[MAX_DIMINUTIVE_LT],
    
fType,
    
fNumberOfRank,
    
fMaxMembers,
    
fPay,
    
fBank,
    
fState,...
};
new 
f_Info[MAX_ALL_FACT][E_FACTION_INFOS];
    for(new 
1E_FACTION_INFOS:fNamemax_fields_per_table[STATS_INFOS]; i++, k++)
    {
        
mysql_format(dbsec_querysizeof(sec_query), ", `%s` = '%s'"SQL_Fields[0][i][sqlName], SQL_Fields[0][i][sqlSpecifier]);
        
printf("[debug-A] %s"sec_query);
        
mysql_format(dbsec_querysizeof(sec_query), sec_queryf_Info[factionid][k]);
        
printf("[debug-B] %s\n"sec_query);
        
strcat(querysec_query);
    } 
It simply print as : f_Info[factionid][fName][0], f_Info[factionid][fName][1], ... instead of f_Info[factionid][fName], f_Info[factionid][fDiminutive].
NB: The loop works correctly apart from the string values

Second question: 4D arrays cost a lot of memory or there any changes?

Edit: I can't use an another dimensions in the loop.
Reply


Messages In This Thread
Loop an enum - by Dayrion - 02.06.2017, 20:45
Re: Loop an enum - by CheezIt - 03.06.2017, 03:34
Re: Loop an enum - by Dayrion - 03.06.2017, 12:00
Re: Loop an enum - by SyS - 03.06.2017, 12:35
Re: Loop an enum - by Dayrion - 03.06.2017, 14:07
Re: Loop an enum - by GhostHacker9 - 03.06.2017, 14:27
Re: Loop an enum - by Dayrion - 04.06.2017, 00:55
Re: Loop an enum - by CheezIt - 04.06.2017, 01:21
Re: Loop an enum - by SyS - 04.06.2017, 01:45
Re: Loop an enum - by SyS - 04.06.2017, 02:37

Forum Jump:


Users browsing this thread: 2 Guest(s)