[lazarus] Corrupted form
TonyM at nlisc.com
Thu Sep 19 21:57:18 EDT 2002
From: Mattias Gaertner [mailto:nc-gaertnma at netcologne.de]
> The .lrs file? You have edited the .lrs file manually?
> Do you mean the .lfm file?
Only to fix the errors. For instance just now it corrupted a button called BtnDepositOk.
While I still had Lazarus open, everything was fine in the environment, but when I built the project it would crash and the form resource reports unknown property 'TABSTA'. I opened unitmain.lrs and on line 86 I see:
You can see the TABSTTA in the middle there... which is wrong. The amount of characters is correct, but the text has been corrupted.
Opening the unitmain.lfm file at the same time shows everything is fine in it...
Close Lazarus, saving changes. Now here's what is in the unitmain.lfm starting at line 326:
object BtnDepositOK: TBUTTON
ANCHORS = [aktop, akleft]
CAPTION = 'OK'
TABSTTA = False
VISIBLE = False
ONCLICK = BtnDepositOkCLICK
LEFT = 477
HEIGHT = 15
TOP = 104
WIDTH = 75
Again, the TABSTTA has appeared. Sometimes it's the name of the object that's corrupted, sometimes another property. Always the NUMBER of characters is the same, they are just wrong.
If I go in and fix both files to read TABSTOP everything is peachy again.
>> The more controls on a form the more likely it is to happen.
> Hmm ...
Actually, I think it always happens on or around line 86 of the .lrs file. I've seen it happen in a property that wrapped from line 85 to 86 and in the middle of 86. I wasn't watching close to begin with, but I'm pretty sure it's always right around there.
> Yes, there is a bug in drag moving, but I'm not sure if this results in
> renaming components.
This time the only thing I did was edit properties of buttons to not be visible. It does only seem to happen when I work with the form designer, though. If all I do is change code, it doesn't seem to happen.
>> I actually think the editor has detected the changes before because once
>> or twice when I've had the editor open it has flagged that a file
>> changed while I had it open even though I hadn't changed anything.
>What files were flagged and were they opened?
I don't recall.. it's only happened twice and it was yesterday. Could be something else entirely because it doesn't happen every time, that's for sure.
>> The corruption seems to start in the .lrs file but will ultimately be
>> mirrored in the .lfm file as well (perhaps the next time you open the
>Now that is strange. The .lfm file and the .lrs file are always saved >together. And the .lfm file is created after the .lrs file. So, the error >should always be in both.
Is the .lrs file saved by itself when only building a project - getting it ready for the linker or something? Or is the .lfm file modified when you open a project to make it sync with the lrs? These seem like possibly what's happening... Sooner or later the .lfm has the error too, but not always immediately.
Thanks for the help...
More information about the Lazarus