Recent

Author Topic: [SOLVED] many developers howto  (Read 3305 times)

mirce.vladimirov

  • Sr. Member
  • ****
  • Posts: 261
[SOLVED] many developers howto
« on: May 02, 2012, 12:35:33 pm »
I'm using winXP sp2, Lazarus 0.9.30, freepascal 2.4.2.
We (two of us, me and my coleague) are developing a same project which is consisted of many Forms, and we use separate computers.
We use only one TMySQLConnection, placed onto the main menu form. When I develop a form on my computer and copy it to the other computer (i only copy myForm.LFM and myForm.PAS), my form missess the link to the TMySQLConnection and I cannot use the connection of the menu-form of this new environment. Now we have to create new connection to the database, i dont want one connection on each form, i want one connection per one application, and all forms to use the same connection.
Note that both of us are using same names of the menu-form and connection and transaction.
« Last Edit: May 02, 2012, 01:43:34 pm by mirce.vladimirov »

mirce.vladimirov

  • Sr. Member
  • ****
  • Posts: 261
Re: many developers howto
« Reply #1 on: May 02, 2012, 01:08:57 pm »
And if I type manually in the Object Inspector under "Database" :
Code: [Select]
myMenuForm.MySQLConnection and press Enter, I'm getting a message "Invalid Property Value"

mirce.vladimirov

  • Sr. Member
  • ****
  • Posts: 261
Re: [SOLVED] many developers howto
« Reply #2 on: May 02, 2012, 01:52:39 pm »
To include new forms into an existing project :
1. copy the already developed form (its *.LFM and *.PAS file) from someone elses computer to yours, into your project's folder
2. start Lazarus IDE
3. From Lazarus menu, Project->Open Project->your project
4. After your project was opened, from Lazarus menu File->Open choose the new form and rise the editor
5. After your new form was opened, from Lazarus menu : Project->Add Editor File to Project (Shift+F11) and thats it,

Simple copying/pasting files and adding line into projects code is not good enough, doesnot work that way.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8819
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: [SOLVED] many developers howto
« Reply #3 on: May 02, 2012, 04:19:51 pm »
Quote
i dont want one connection on each form, i want one connection per one application, and all forms to use the same connection.
You should use data module for this kind of situation. In fact, I suggest using it whenever you need database access, chances are big that your apps will grow someday.
Quote
Simple copying/pasting files and adding line into projects code is not good enough, doesnot work that way.
You should start using version control system, this way you don't have to copy manually, easily rollback to previous version if a change breaks existing code, etc. that would be difficult to do when doing it without version control system. Anyway, just copying and adding uses clause won't work, as a project information is managed in .lpi file, which has references to project's files. Therefore, whenever a new unit is made, it has to be registered there (via project inspector, or project->add editor file as you did). Using (decent) version control system, when you AND other developers add different new units, both of your changes could be merged together (semi-)automatically such that this kind of problem won't appear. I suggest Mercurial as it's very easy to setup and use, has powerful merging algorithm, could do local commit, etc.

 

TinyPortal © 2005-2018