begin process at 2010 02 10 12:01:52
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

Turbo Pascal

 > REMPLACER LE TEXTE PAR DES * DANS UN READLN

REMPLACER LE TEXTE PAR DES * DANS UN READLN


 Information sur la source

Note :
6 / 10 - par 1 personne
6,00 / 10

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10
Catégorie :Turbo Pascal Niveau :Initié Date de création :07/09/2003 Date de mise à jour :07/09/2003 13:48:57 Vu :3 325

Auteur : Glorkonline

Ecrire un message privé
Site perso
Commentaire sur cette source (0)
Ajouter un commentaire et/ou une note

 Description

Bon, en fait, c'est pas tout à fait un readln, mais çà s'inscrit dans une string.

Source

  • function askpassword (passwordchar : char; minlength, maxlength : Longint) : String;
  • var
  • C : Char;
  • S : String;
  • begin
  • S := '';
  • Repeat
  • C := Readkey;
  • If ((C <> chr(13)) and (C <> chr(8)) and (length(S) <> maxlength)) then Write(passwordchar);
  • If ((C <> chr(13)) and (C <> chr(8))and (length(S) <> maxlength)) then S := S + C;
  • If length(S) = maxlength then write(chr(7));
  • If C = chr(8) then S := '';
  • If ((C = chr(13)) and (length(S) < minlength)) then Write(chr(7));
  • Until ((C = chr(13)) and (length(S) > minlength - 1));
  • askpassword := S;
  • end;
  • appelez la fonction comme ça :
  • var
  • password : String;
  • begin
  • password := askpassword(<le caractère qui remplacera les lettres (souvent '*')>,<le length minimum du password si pas : 0>,<le length maximum fu password si pas : -1>);
  • end.
function askpassword (passwordchar : char; minlength, maxlength : Longint) : String;
var
 C : Char;
 S : String;
begin
S := '';
Repeat
C := Readkey;
If ((C <> chr(13)) and (C <> chr(8)) and (length(S) <> maxlength)) then Write(passwordchar);
If ((C <> chr(13)) and (C <> chr(8))and (length(S) <> maxlength)) then S := S + C;
If length(S) = maxlength then write(chr(7));
If C = chr(8) then S := '';
If ((C = chr(13)) and (length(S) < minlength)) then Write(chr(7));
Until ((C = chr(13)) and (length(S) > minlength - 1));
askpassword := S;
end;

appelez la fonction comme ça :
var
 password : String;
begin
password := askpassword(<le caractère qui remplacera les lettres (souvent '*')>,<le length minimum du password si pas : 0>,<le length maximum fu password si pas : -1>);
end.

 Conclusion

Glorkonline --- Glorkonline.be.tf --- Glorkonline@hotmail.com


 Sources du même auteur

Source avec Zip Source avec une capture VERROU WINDOWS
CRYPTER TOUT VOS FICHIERS
LA SOURIS À BUT !
Source avec Zip CRYPTEUR DE FICHIERS TEXTE.
Source avec Zip CRÉER UN PETIT CONSEIL.

 Sources de la même categorie

CONVERSION D'UN NOMBRE COMPRIS 0 ET 999999999999999999 (18 C... par Hror
JEU DE BOULE par abdellahsaida
Source avec Zip ALGORITHME DU JEU TETRIS par darrylsite
Source avec Zip LE JEU NGRI-NGRAN par darrylsite
Source avec Zip CONVERSION D' UN NOMBRE EN TOUTES LETTRES par darrylsite

Commentaires et avis

Aucun commentaire pour le moment.

 Ajouter un commentaire




Nos sponsors


Sondage...

Comparez les prix

CalendriCode

Février 2010
LMMJVSD
1234567
891011121314
15161718192021
22232425262728

Consulter la suite du CalendriCode

 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 0,421 sec (3)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales