Zaklady hudby

prichy@volny.cz prichy
Středa Březen 17 14:54:23 CET 2004


Compiler vas upozor?uje na mo?nost, ?e f-ce vr?t? nedefinovanou hodnotu.
Tato situace nastane v p??pad?, ?e Combo.ItemIndex bude m?t jinou
hodnotu ne? 0 .. 4.
Zkuste nap??klad na za??tku f-ce n?jakou n?vratovou hodnotu definovat.


> 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





Další informace o konferenci Hw-list