AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren

extract and verify

Ein Thema von mohfa · begonnen am 24. Aug 2008 · letzter Beitrag vom 24. Aug 2008
Antwort Antwort
mohfa

Registriert seit: 11. Feb 2007
97 Beiträge
 
Delphi 7 Enterprise
 
#1

extract and verify

  Alt 24. Aug 2008, 19:15
Hello :

Const Head:String='BTR';

Var
S:String ;
Begin
S:='myfirstfile.doc';

end;

So what i want is :

to verify that the S always starts with 'BTR' i mean like

if not (S) starts with ('BTR') then exit else Continue .


S:=BTRmyfirstfile.doc =True
S:=myfirstfile.doc =false

and i want to be sure the file name contains only A..Z or 0..9 so only letters and numbers .

How could i do like this verification .


Thank you
  Mit Zitat antworten Zitat
Benutzerbild von toms
toms
(CodeLib-Manager)

Registriert seit: 10. Jun 2002
4.648 Beiträge
 
Delphi XE Professional
 
#2

Re: extract and verify

  Alt 24. Aug 2008, 19:45
Hello

Zitat:
to verify that the S always starts with 'BTR' i mean like

if not (S) starts with ('BTR') then exit else Continue .
The function AnsiStartsStr() indicates whether one string is a (case-sensitive) prefix of another.

AnsiStartsStr returns True if the string specified by ASubText appears as the leading part of the string specified by AText. Comparison is performed case-sensitively.


Zitat:
and i want to be sure the file name contains only A..Z or 0..9 so only letters and numbers .
Go through all characters in the string and check if they are within the desired range (A..Z or 0..9)
Thomas
  Mit Zitat antworten Zitat
Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Ansicht

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 22:44 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