[Lazarus] Clearing a project

Mark Morgan Lloyd markMLl.lazarus at telemetry.co.uk
Tue Feb 5 12:25:27 CET 2013


Mattias Gaertner wrote:
> On Tue, 05 Feb 2013 09:12:35 +0000
> Mark Morgan Lloyd <markMLl.lazarus at telemetry.co.uk> wrote:
> 
>> Mattias Gaertner wrote:
>>
>>>> I know, but as I've said above there's a list of units stored in the 
>>>> .lpi as well. How does one clear this?
>>> This list gives the IDE the clues what files are important and what not.
>>> So, you should not clear it, you should clean it up and add all
>>> missing project units. For example via the Project Inspector.
>> I'm sorry, I took my eye off the ball since I was still looking at the 
>> stored paths.
>>
>> One final question if I may: if the .lps has been deleted, what controls 
>> the IDE's choice of which unit to open when it starts? It looks as 
>> though it currently opens the most-recently-added unit, is it possible 
>> to change this to be the first-added unit on the basis that this is most 
>> likely to be in the project directory, or to open the .lpr as probably 
>> the safest choice?
> 
> Please test with 40191.

Nice, and I think it fixes the naming issue from our earlier discussion 
(but testing continues).

FYI, looking at a freshly-created (after correcting the intentional 
error I'd left in one unit) .lps I notice

       <Unit0>
         <Filename Value="HeavyWethers.lpr"/>
         <IsPartOfProject Value="True"/>
         <UnitName Value="HeavyWethers"/>
         <UsageCount Value="20"/>
       </Unit0>
       <Unit1>
         <Filename Value="heavywetherscode.pas"/>
         <IsPartOfProject Value="True"/>
         <ComponentName Value="HeavyWethersForm"/>
         <HasResources Value="True"/>
         <ResourceBaseClass Value="Form"/>
         <UnitName Value="HeavyWethersCode"/>
         <EditorIndex Value="0"/>
         <WindowIndex Value="0"/>
         <TopLine Value="1"/>
         <CursorPos X="1" Y="1"/>
         <UsageCount Value="20"/>
         <Loaded Value="True"/>
         <LoadedDesigner Value="True"/>
       </Unit1>
..
       <Unit12>
         <Filename Value="../../inifiles/trunk/dbconfigcode2.pas"/>
         <IsPartOfProject Value="True"/>
         <ComponentName Value="DbConfigFrame"/>
         <HasResources Value="True"/>
         <ResourceBaseClass Value="Frame"/>
         <UnitName Value="DbConfigCode2"/>
         <UsageCount Value="20"/>
       </Unit12>
       <Unit13>
         <Filename Value="../inifiles/trunk/dbconfigcode2.pas"/>
         <ComponentName Value="DbConfigFrame"/>
         <HasResources Value="True"/>
         <ResourceBaseClass Value="Frame"/>
         <UnitName Value="DbConfigCode2"/>
         <IsVisibleTab Value="True"/>
         <EditorIndex Value="1"/>
         <WindowIndex Value="0"/>
         <TopLine Value="4"/>
         <CursorPos X="4" Y="22"/>
         <UsageCount Value="10"/>
         <Loaded Value="True"/>
         <LoadedDesigner Value="True"/>
       </Unit13>

where if I (finally) understand things correctly Unit0...Unit12 are 
describing the files in the project and Unit13 is describing the file 
that is open on the screen. The only reason I mention this is that the 
two units that are open are HeavyWethersCode (one entry in the list 
above) and DbConfigCode2 (two entries in the list, with different 
paths)... please ignore me if this is intentional :-)

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]




More information about the Lazarus mailing list