Comments to Source code for Shopping List app version 1.0

I am new to C programming (and is only a beginner at Delphi and Basic) and would appreciate any comments and suggestions you may have - especially if you see something that could in certain cases lead to crashes.

Concrete questions is how to allocate memory, and releasing it afterwards. I have freed (qfree) all pointers I have used (at various times in the program execution), but am not sure when it is neccessary to allocate memory.

I am sure my code is not very efficient. I could probably have passed more variables in the functions (in fact I didn't dare do any).

The saving of the database to the memo, was done through a lot of trial and error, and since it is not working after a hard reset, I'll try and work on that. As can be seen from the code, I could remove some control characters like tab and return. That might fix the problem (I hope), since somehow a character must either be added or removed on the PC(?)after a hard reset.

I hope this can be of help to others that want to make programs for the Helio.

Disclaimer
I have tried to test this program extensively, first on the emulator and then on my Helio, and it seems to be running fine. However I have lots of memory available and I do not know how the program will work under a different situation. 
 I did get one protection fault, but since I afterwards was unable to duplicate it, I haven't done anything to the code. 
I MAKE NO GUARANTEES FOR THE EFFECT THIS PROGRAM MAY HAVE ON YOUR HELIO.