Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Check for Side-By-Side matching characters
Message
De
11/06/2003 09:33:26
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00798873
Message ID:
00798885
Vues:
33
This message has been marked as a message which has helped to the initial question of the thread.
>Does anyone have a way to check a string to ensure that there are not two like characters side by side. This is for a password validation routine?
>
>Thanks
Function HasNeighbourChar
lparameters tcStr
local llNeighBour, lcTemp, lnLastChar, lnCurChar
lcTemp=sys(2015)+'.tmp'
StrToFile(tcStr,lcTemp)
lnLastChar = -1
lnHandle=fopen(lcTemp)
do while !feof(lnHandle)
 lnCurChar = asc( fread(lnHandle,1) )
 if lnCurChar = lnLastChar
  * Neighbour chars
  llNeighBour = .T.
  exit
 else
   lnLastChar = lnCurChar
 endif
enddo
fclose(lnHandle)
erase (lcTemp)
return llNeighbour
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform