OT:zase trochu Delphi

Miroslav Sinko sinkomiro
Středa Březen 17 14:54:23 CET 2004


V Delphi neprogramujem, ale programovanie v C++ ma zivi...
Podla mna Vas kompilator upozornuje na to, ze ak bude Combo.Index ine
ako 0 az 4, tak navratova hodnota bude nedefinovana. Na koniec funkcie
si dajte result:=nieco.


--- prichy@volny.cz wrote:
> Napsal jsem si takovouto f-ci v Delphi (6)
> 
> function TForm1.logika (A:Boolean;B:Boolean;Combo:TComboBox):Boolean;
>  begin
>   If Combo.ItemIndex = 0 then
>   result:= A and B;
>   If Combo.ItemIndex = 1 then
>   result:= A or B;
>   If Combo.ItemIndex = 2 then
>   result:= not(A and B);
>   If Combo.ItemIndex = 3 then
>   result:= not(A or B);
>   If Combo.ItemIndex = 4 then
>   result:= A xor B;
> end;
> 
> Compiler me odmenil timto
> 
> [Warning] Unit1.pas(318): Return value of function 'TForm1.logika'
> might be
> undefined
> 
> 
> program funguje normalne, ale ta hlaska ( zvlast s moji znalosti
> angl.) me stve,
> jsou i pripady kdy se neobjevi (malo, 1/20 spusteni).
> Co delam spatne?
> Pri te prilezitosti, co predani objektu, je to takhle bezne nebo se
> to osetruje
> jinak?
> Prosim poradte.
> 
> --
> prichy@volny.cz
> (W98SE,D6,8051)
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com




Další informace o konferenci Hw-list