Forum > Beginners

Please Explain how Forms and Units Integrate

(1/2) > >>

flywire:
I am trying to get comfortable with Lazarus. I have a heap of experience with a range of procedural programming languages many years ago but limited experience with OO programming although my database experience means I have no problems with the concepts of objects, properties and instances.

I would appreciate a bit of a guide on how the various files fit together:

* As I understand it you create a project and need to create a unit at the start. Should the first unit be called main?
* Where does the application start - first form or main unit?
* How are the other units called?

typo:
1) It "could" be called main as probably most developers make when starting a project, at least if there is not a more descriptive name.
2) The application starts at the LPR project file;
3 ) The other units can be called at any time from the main unit or project file. If you create it at design time, they are created and ready to use.

Leledumbo:

--- Quote from: flywire on February 04, 2015, 01:07:05 pm ---As I understand it you create a project and need to create a unit at the start. Should the first unit be called main?

--- End quote ---
No. And program does NOT start from a unit (although it can have initialization section which will be executed before program start), program starts from a program (.lpr in Lazarus project realm).

--- Quote from: flywire on February 04, 2015, 01:07:05 pm ---Where does the application start - first form or main unit?

--- End quote ---
Back to previous answer.

--- Quote from: flywire on February 04, 2015, 01:07:05 pm ---How are the other units called?

--- End quote ---
Interlinked recursively via uses clause, starting from the program.

User137:
Easiest way to open the main source is from menus:
Project -> View Project Source

flywire:

--- Quote from: User137 on February 05, 2015, 10:02:37 am ---Easiest way to open the main source is from menus:
Project -> View Project Source

--- End quote ---

I am getting errors on the demo programs that I put in out of 'Start Programming using Object Pascal' News application in Object Oriented Pascal p135 because I tried to run it without putting in the form. I want to understand how to fix the errors. What is the best way to work through the program (in procedural terms from beginning to end)?

Navigation

[0] Message Index

[#] Next page

Go to full version