PDA

View Full Version : Moving from Delphi/Kylix to Lazarus, Free Pascal



jasonf
02-01-2005, 01:37 AM
OK,

I had a load of trouble with Kylix with my latest SuSE, More trouble than I care to deal with so I've dumped it's Wine Driven bloatedness and installed Lazarus along with Free Pascal.

The IDE is very nice, Very Delphi like. I managed to find my way around without any problems. Setting up my projects seems the same as Delphi. So no probs there.

The only problem I'm having is when I try to compile.

I have a TStringlist and I'm using the GetCount() function to determine the nuber of items.

Trouble is when I say if GetCount() > 0 , it gives an error "Incompatible types: got "TStringList.GetCount:LongInt" expected "LongInt"

This is obviously a newbie problem, can anyone give me a clue so I can fix this?

This code compiled fine under Kylix on my old Linux partition.

Cheers

Almindor
02-01-2005, 07:48 PM
TStringList.GetCount is a protected function should be used only internally. You can use TStringList.Count to get the same results.

jasonf
02-01-2005, 10:41 PM
You are a complete genius. That was the problem. Changing to Count instead of GetCount fixed that particular compilation problem. I don't recall why I'd used GetCount in the first place now.

Told you it was a newbie question :)

Many Thanks.

plugwash
05-01-2005, 06:26 PM
fpc sometimes gives f*cked up error messages.