Nie chodzi mi o samo indeksowanie ale o blad, ktory pojawia mi sie w ponizszej funkcji... Jesli ktos moglby mnie oswiecic to bede wdzieczny bo teraz z rana nie moge dojsc co ten kompilator chce :P Dzieki z gory za wszelka pomoc :)
TComponent TForm1::Komponent(AnsiString Nazwa)
{
int x;
for(x=0;x<ComponentCount-1;x++)
if(Components[x]->Name==Nazwa)
{
Kompo=Components[x];
return Components[x];
}
}
A tu w public deklaracje :
class TForm1 : public TForm
{
(...)
public: // User declarations
TComponent *Kompo;
TComponent Komponent(AnsiString Nazwa);
(...)
};
A to komunikaty:
[C++ Error] Unit1.cpp(213): E2459 VCL style classes must be constructed using operator new
[C++ Warning] Unit1.cpp(215): W8070 Function should return a value