Raised This Month: $ Target: $400
 0% 

Solved Contain in .ini dont work


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-29-2021 , 14:48   Re: Contain in .ini dont work
Reply With Quote #2

contain() and containi() return the index of the match. If it does not contain the string, it returns -1 (which will return true if used directly as the condition of an if statement). So, to properly check if a string contains another string, you need to use:

Code:
if( contain() >= 0 )
or
Code:
if( contain() != -1 )
P.S. you are reading the file incorrectly in your loop. You should use fgets() as the while loop condition. Also, you are potentially going to cause an index out of bounds because you are using the wrong value for the third argument of fgets(). You need to use charsmax(szFileData) instead of 50000.
__________________

Last edited by fysiks; 07-29-2021 at 14:51.
fysiks is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:29.


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