chssoccer Posted January 14, 2008 Share Posted January 14, 2008 How do I check if a section in an INI contains anything and if it doesn't then it will go to a certain function otherwise continue? Link to comment Share on other sites More sharing options...
Pioneer5250 Posted January 14, 2008 Share Posted January 14, 2008 try this! $aRead = IniReadSection('test.ini', 'SECTION') If Not IsArray($aRead) Then _Func() For $i = 1 To $aRead[0][0] MsgBox(0,'',$aRead[$i][0] & '=' & $aRead[$i][1]) Next Func _Func() MsgBox(0,'','Nothing in section') EndFunc Link to comment Share on other sites More sharing options...
rasim Posted January 14, 2008 Share Posted January 14, 2008 How do I check if a section in an INI contains anything and if it doesn't then it will go to a certain function otherwise continue? Try this: If Not FileExists("c:\test.ini") Then MsgBox(16, "Error", "Unable open file") Exit EndIf Dim $aReadSection = IniReadSection("c:\test.ini", "SectionName") If @error Then MyFunc() Exit EndIf Func MyFunc() ;your code EndFunc Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now