Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2007-10

list classes or arrays in FPC

6 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

Anybody know what list classes or arrays are available in FPC? I know the standard TObjectList and TStringList, but I'm pretty sure there must be more 'not so well known' lists available.

I'm busy implementing a Objects[ARow, ACol] property for fpGUI's StringGrid component and would like to read up on what efficient list classes or arrays I could possibly use. I'll only be storing Pointers and the StringGrid will *not* be maintaining the lifespan of the Objects being stored. Only their pointers will be stored, so I guess it doesn't need to be a complex list class or pointer array.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Hans Mårtensson
to Graeme Geldenhuys

The FPC documentation prog.pdf (win32 version) explains how to use the windres.exe to format data such that the FPC compiler can include them i the exe file as a resource that can be used by the program via the windows API's. But only for string tables. Yet it indicates that the windres.exe program can do the same for other kinds of data. I am interested in the category "Arbitrary data".

Does anybody have a reference to a manual or something that explains how to make windres.exe put these data into a .res file?

Hans Maartensson

Reply by email

Joao Morais
to Graeme Geldenhuys: Anybody know what list classes or arrays are available in FPC? I know the standard…
Graeme Geldenhuys wrote
Anybody know what list classes or arrays are available in FPC? I know the standard TObjectList and TStringList, but I'm pretty sure there must be more 'not so well known' lists available.

contnrs unit?

Show quoted text 6 lines
I'm busy implementing a Objects[ARow, ACol] property for fpGUI's StringGrid component and would like to read up on what efficient list classes or arrays I could possibly use. I'll only be storing Pointers and the StringGrid will *not* be maintaining the lifespan of the Objects being stored. Only their pointers will be stored, so I guess it doesn't need to be a complex list class or pointer array.

You could use variant arrays or two dynamic arrays, but I personally prefer classes. This approach could be reached using a TObjectList instance to hold TObjectList objects, the getter should have something like this:

Result := ((FObjList[ARow] as TObjectList)[ACol] as TYourTargetClass);

Hth.

Joao Morais

Reply by email

Graeme Geldenhuys
to Joao Morais
Joao Morais wrote 11 lines
> I'm busy implementing a Objects[ARow, ACol] property for fpGUI's > StringGrid component and would like to read up on what efficient list > classes or arrays I could possibly use. I'll only be storing Pointers > and the StringGrid will *not* be maintaining the lifespan of the > Objects being stored. Only their pointers will be stored, so I guess > it doesn't need to be a complex list class or pointer array. You could use variant arrays or two dynamic arrays, but I personally prefer classes. This approach could be reached using a TObjectList instance to hold TObjectList objects, the getter should have something like this:

I don't like variants (I personally think they are a hack) and wasn't to keen on arrays either - I also prefer classes. In the end it was really easy and didn't need to add any extra classes or have to add extra code to maintain the size on the container. I simply hooked into the TStringList that stores the Cell text and used it's Object property.

Thanks for the reply...

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Hans Mårtensson
to Felipe Monteiro de Carvalho
Felipe Monteiro de Carvalho wrote 9 lines
I don't know any manual, but I vaguely remember that RCDATA is a kind of data on .rc files which can accept arbitrary data With the correct parameters on google you can search for example .rc files which use RCDATA http://www.google.com/codesearch?hl=en&lr=&q=rcdata+file%3A%5C.%28rc%29%24&btnG=Search

Yes windows has a resource type called RT_RCDATA.
My problem is how to format data of this format in a .rc file (that can be compiled by windres.exe.)

I didn't know about the google codesearch option, but will now try this way to find a usefull example of code.

Thank you for the help.

Hans Mårtensson

Reply by email