AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Taschenrechner - String durchsuchen

Ein Thema von Speedi2000 · begonnen am 28. Feb 2010 · letzter Beitrag vom 1. Mär 2010
 
Speedi2000

Registriert seit: 28. Feb 2010
15 Beiträge
 
#27

Re: Taschenrechner - String durchsuchen

  Alt 1. Mär 2010, 17:28
Woah, um ehrlich zu sein seh ich da garnicht durch mit der Liste und so, denke das ist auch noch zu hoch für das Niveau wie wir den Taschenrechner machen sollen, weil wir haben ja mit Delphi grade erst angefangen.

Danke schonmal für die Hilfe, aber so kann ich das denk ich schlecht machen, weil wir ja soweit noch nicht sind =/

Muss ich wohl weiter mit meinem rumprobieren

EDIT://
Delphi-Quellcode:
if neo.caption = '*'
then
begin
ne.caption := floattostr(strtofloat(ne.caption)*strtofloat(display.text));
display.text := '0';
neo.caption := '*';
end
else
begin
if nz1.caption = ''
then
begin
nz1.Caption := display.text;
no1.caption := '*';
display.text := '0';
end
else
begin
nz2.caption := display.text;
no2.caption := '*';
punkt.caption := floattostr(strtofloat(nz1.caption)*strtofloat(nz2.caption));
if neo.caption = '+'
then
begin
ne.caption := floattostr(strtofloat(ne.caption)+strtofloat(punkt.caption));
nz1.caption := '';
nz2.caption := '';
no1.caption := '';
no2.caption := '';
neo.caption := '*';
end;
if neo.caption = '-'
then
begin
ne.caption := floattostr(strtofloat(ne.caption)-strtofloat(punkt.caption));
nz1.caption := '';
nz2.caption := '';
no1.caption := '';
no2.caption := '';
neo.caption := '*';
end;
if neo.caption = '*'
then
begin
ne.caption := floattostr(strtofloat(ne.caption)*strtofloat(punkt.caption));
nz1.caption := '';
nz2.caption := '';
no1.caption := '';
no2.caption := '';
neo.caption := '*';
end
end
end
end;
Habe jetzt das Problem dass wenn er im neo.caption nen '-' drin zu stehen hat, er irgendwas rechnet, aber nicht das was er soll... z.B. bei 5+5+5+5+5-6*3*(an der stelle bekommt er 126 raus und nicht 7 wie er eigentlich sollte).

Find meinen Fehler aber nicht
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 21:51 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz