くだすれDelphi(超初心者用)その25
■ このスレッドは過去ログ倉庫に格納されています
0774デフォルトの名無しさん
2005/07/03(日) 16:19:30var
Atext : String;
Apos : Integer;
begin
Atext := Edit1.Text + Edit2.Text ;
//足すの場合
Apos := AnsiPos('+',AText);
if Apos <> 0 then
begin
result := StrToInt(Edit1.text) + StrToInt(Edit2.text)
Apos:=0;
end;
//かけるの場合
Apos := AnsiPos('*',AText);
if Apos <> 0 then
begin
result := StrToInt(Edit1.text) * StrToInt(Edit2.text)
Apos:=0;
end;
//引くと割るの場合は自分で考えてみよう。それと、TEdit.textの値が有効なものか事前にチェックする必要がある。
end;
■ このスレッドは過去ログ倉庫に格納されています