AGB  ·  Datenschutz  ·  Impressum  







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

is_numeric control number

Ein Thema von sk.Silvia · begonnen am 17. Jul 2006 · letzter Beitrag vom 17. Jul 2006
Antwort Antwort
Benutzerbild von sk.Silvia
sk.Silvia

Registriert seit: 8. Feb 2006
Ort: Slovenia
90 Beiträge
 
Delphi 7 Personal
 
#1

is_numeric control number

  Alt 17. Jul 2006, 13:57
hi there
is there a simple way to control if input-string is a real number (like in php is_numeric) (so i dont have to go by each char, count the dots and ask if char is in 0-9...)

smt like
if ReturnedError(strtofloat(input)) then ShowMessage('you dont entered a valid real number');
  Mit Zitat antworten Zitat
Thorben77

Registriert seit: 22. Okt 2004
359 Beiträge
 
#2

Re: is_numeric control number

  Alt 17. Jul 2006, 14:05
Hi Silvia,
you may have a look at the Delphi-Referenz durchsuchenTryStrToFloat function .
  Mit Zitat antworten Zitat
Benutzerbild von DGL-luke
DGL-luke

Registriert seit: 1. Apr 2005
Ort: Bad Tölz
4.149 Beiträge
 
Delphi 2006 Professional
 
#3

Re: is_numeric control number

  Alt 17. Jul 2006, 14:06
Delphi-Quellcode:
if not trystrtofloat(somestring,somefloat) then
  Showmessage('Doh!');


// I knew i couldn't be the first one...
Lukas Erlacher
Suche Grafiktablett. Spenden/Gebrauchtangebote willkommen.
Gotteskrieger gesucht!
For it is the chief characteristic of the religion of science that it works. - Isaac Asimov, Foundation I, Buch 1
  Mit Zitat antworten Zitat
Antwort Antwort


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 04:55 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz