Ah, sounds like you have ACDS*, you cannot possibly write code when you have ACDS. Fix that and all will be well.
Seriously, Lazarus has very infrequent internal problems that might need a restart. Try and record the next error message you get and post it, life will be heaps easier if you fix the problem.
Davo
* ACDS = Acute Caffeine Deprivation Syndrome