what is TCollection.GetAttrCount EQUAL in Lazarus ?? lazarus / 31-LCL ---------------------------------------------------------------------- freeman35 · 2013-09-18 12:55 TCollection.GetAttrCount -> what is equal lazarus TCollection.GetAttr -> what is equal lazarus Description: This method is provided for compatibility with Delphi only and is not used in Free Pascal. I'm try convert I used component in Delphi, I found problem on this functions. This is great, great because I'm looking for this error as long as 2 month. Result always return 0. Why NOT raise exception "This function JUST work on Delphi"? so no body loose time ---------------------------------------------------------------------- Leledumbo · 2013-09-18 15:13 QuoteWhy NOT raise exception "This function JUST work on Delphi"Not a good runtime behaviorIt's already stated in the doc that those methods are not used in Free PascalI think you better state what you need with those methods. ---------------------------------------------------------------------- freeman35 · 2013-09-18 21:47 Its not my choose. I'm trying convert from delphi some component. I work on long time pascal, and delphi all version last one XE2. I didn't see some function or class property,  this is not work on delphi so I use to if code complied add this function and no any error, I'm think this is write code raise exception why not ? read all help or when try to use function raise exeption and give filename function name line number and any detail string, son I change my code, or looking for as long as to month at this moment I have to check all source code, maybe inherited and bas class say not use for free pascal I have so many question mark on today, sorry ---------------------------------------------------------------------- Leledumbo · 2013-09-19 15:47 Actually I never use Delphi or TCollection(Item) directly myself, so I have no idea what those attributes are for (weird design for me, if attributes are associated with TCollectionItem, it should be part of TCollectionItem, not TCollection) nor how it affects the behavior of certain properties/methods of TCollection. If you can point me to a document explaining this, I might be able to help. I would use a more proper data structure, however. ---------------------------------------------------------------------- freeman35 · 2013-09-22 10:02 I was set time break I was so bored In delphi component used this function for set columns with, I can see row count but no caption 'cos Column with 0 and its not painting. Looking for whats wrong as long as two days I saw this function always return 0  and wrote in help "sorry this code for just delphi" Help for TCollection.GetAttrCount http://lazarus- ccr.sourceforge.net/docs/rtl/classes/tcollection.getattrcount.html class source (I'm useing svn) /freepascal/2.7.1/rtl/objpas/classes/collect.inc line start 229 Code: [Select]function TCollection.GetAttrCount: Integer; begin   Result:=0; end; function TCollection.GetAttr(Index: Integer): string; begin   Result:=''; end; function TCollection.GetItemAttr(Index, ItemIndex: Integer): string; begin   Result:=TCollectionItem(FItems.Items[ItemIndex]).DisplayName; end; Result:=0; and  Result:=''; Is NOT different in Delphi. I checked XE2 delphi source code. Not imported for me 'cos I fixed digit column with and delete GetAttrCount and others similar codes in my component. My idea is If its note work why that codes is  there ? If codes will work in delphi, compiler directive maybe usefull. Who try convert delphi component to lazarus need to hard work. I fixed my problem, thank you ---------------------------------------------------------------------- BigChimp · 2013-09-22 11:49 I have trouble understanding the English in your post, but if you have patches to improve FPC, please open a bugtracker item and attach the patch. Thanks. ---------------------------------------------------------------------- freeman35 · 2013-09-23 07:51 Sorry for my english, I learned from dictionary.  bug report ID #25048  Mattias Gaertner sented pach and it's corrected, but not yet fixed in source bug report ID #25049 I was write solution but not accepted and fixed. I mean, If I fix something exactly  I'll share, 'cos don't like always ask question, I prefer answer Sorry but one more question How to make patch file? I'm use kubuntu 13.04.  I try diff application but I can't do it,maybe I can't choose correct params Thank you ---------------------------------------------------------------------- BigChimp · 2013-09-23 08:08 Quote from: freeman35 on September 23, 2013, 09:51:03 amSorry for my english, I learned from dictionary.  Well, then I think you are doing quite well No need to apologize. Quote from: freeman35 on September 23, 2013, 09:51:03 amSorry but one more question How to make patch file? I'm use kubuntu 13.04.  I try diff application but I can't do it,maybe I can't choose correct params Use svn to generate the patch; see e.g. http://wiki.lazarus.freepascal.org/Creating_A_Patch#Creating_a_patch_u sing_SVN If you still have problems, please post the exact commands you're using... Thanks. ---------------------------------------------------------------------- BigChimp · 2013-09-23 08:13 Quote from: freeman35 on September 23, 2013, 09:51:03 ambug report ID #25048  Mattias Gaertner sented pach and it's corrected, but not yet fixed in source I just read the messages there. As far as I understand, the problem is in FPC, not in Lazarus (the project that you raised the problem). Also, Mattias wrote: QuoteThe attached patch is not tested but gives an idea how to change TWriter. TReader has to be checked if it has the same problem. So that means you're invited to test the patch, improve it if necessary and test TReader, and then submit the patch to the FPC project so it can be fixed properly. Otherwise, nothing will happen and you will have to keep patching FPC yourself... ---------------------------------------------------------------------- freeman35 · 2013-09-23 11:00 Please read my added note on bug tracker system link is "http://bugs.freepascal.org/view.php?id=25048" and my last note is: Quote(0070184) freeman35   (reporter) 2013-09-19 10:13 edited on: 2013-09-19 11:49    Yes, I mean note 70163. Yes Applied your patch and now TOwnedCollection.DefineProperties, TWriter.WriteProperty working. TWriter.ReadProperty not sure yet, I'm not get error, but not sure read real value from stream, I haveto check, I will Yes, TWriter.DefineProperties, TWriter.WriteProperty, TWriter.ReadProperty now work properly for me, This report can close. BUT Bug report number 0025049 still carry on (same class), I hope my solution can add, detail was there If you can not read my note maybe website has a problem ?  After Mattias patch my problem was fixed ---------------------------------------------------------------------- BigChimp · 2013-09-23 11:24 I think I'm just not understanding what you're writing. If you're happy with the results, that's all that counts.