Greetings!!!

I've got a question again..
I'm using the FileOpen function, and I ran into a problem..
I was developing and testing my program, but suddently after some minor modifications the FileOpen function gave a '-1' vaule, which indicates an error. Frankly, I don't even understand how it could have happened... I mean the file name is correct. It cant be incorrect. There's no problem with whatever rights. I only want to read it.
So I got the idea to check what's wrong. There has to be an error code which will tell me what's wrong.
So please help me out. How can I read that error code, and how can I get the exact error looking at the integer value of the error code?

Thanks a lot.