Autor Beitrag
day
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 107



BeitragVerfasst: Do 28.08.03 17:30 
hallo

ich lese mit paramStr() werte aus der Kommandozeile. nun möchte ich überprüfen ob sie auch einigermassen stimmen. wie kann ich überprüfen ob es sich bei einem String um einen integer wert handelt?
Shark
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 87

98, XP
D3, D5, D7
BeitragVerfasst: Do 28.08.03 17:36 
sieh mal in der Hilfe bie VAL nach
derDoc
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 623

Win Vista Prof
D2007 Prof
BeitragVerfasst: Do 28.08.03 17:45 
Bei einzelnen Werten kannst du auch mit
ausblenden Delphi-Quelltext
1:
if isNumeric(char) then					

prüfen, ob es eine Zahl ist.

_________________
MfG derDoc
There are only 10 types of people: those who understand binary and those who don't.
day Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 107



BeitragVerfasst: Do 28.08.03 19:01 
isNumeric kennt er nicht "Undeclared identifier"
welches interface muss ich da noch hinzufügen
derDoc
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 623

Win Vista Prof
D2007 Prof
BeitragVerfasst: Do 28.08.03 21:00 
Das müsste in der Unit IdGlobal sein.

_________________
MfG derDoc
There are only 10 types of people: those who understand binary and those who don't.
day Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 107



BeitragVerfasst: Do 28.08.03 21:16 
danke

wie kriege ich eigentlich welche funktion zu welchem interface gehört. (wenn ich nur die funktionkenne und sie nicht in der hilfe ist)
derDoc
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 623

Win Vista Prof
D2007 Prof
BeitragVerfasst: Fr 29.08.03 09:14 
Jede Standard Delphi Funktion oder Prozedur ist in der Hilfe erklärt. Eventuell must du noch die einige Hilfedateien aus .../Delphi(X)/Help, bzw. .../Borland Shared/MSHelp der Delphi Hilfe hinzufügen.

_________________
MfG derDoc
There are only 10 types of people: those who understand binary and those who don't.
CenBells
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1547

Win 7
Delphi XE5 Pro
BeitragVerfasst: Fr 29.08.03 09:38 
@derDoc: Die function isNumeric ist aber keine standart function... Siehr man ja schließlich daran, daß die aus dem Indy-package kommt. Das ist zwar standartmäßig dabei, kann sich aber schnell zur nächsten version ändern...

@day: besser ist es da schon, jedes einzelne zeichen auf seinen ordinalwert zu überprüfen. Wenn mich nicht alles täuscht, muss der zwischen #49 und #57 liegen, damit das zeichen eine zahl ist.

Gruß
Ken

_________________
Eine Klasse beschreibt die Struktur und das Verhalten einer Menge gleichartiger Objekte.
Taurin
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 34

Win XP
D6 Personal
BeitragVerfasst: Fr 29.08.03 15:25 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
function isNumber(str :string) :bool;
var i :integer;
  begin
  for i := 1 to length(str) do
    if not (str[i] in ['0'..'9']) then
      begin
      result := false;
      Exit;
      end;
  result := true;
  end;


Wenns an die Untersuchung von komplexer aufgebauten strings
kannst du dir mal was zu den Themen endliche Automaten und
Kellerautomaten anschauen.

Grüße,
Alexander