begin process at 2012 02 07 07:12:18
  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 857

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

Source avec Zip CONVERTIR NOMBRE EN CARACTERES par 520550
Source avec Zip JEU DE CULTURE par sliven
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

Commentaires et avis

Aucun commentaire pour le moment.

 Ajouter un commentaire




Nos sponsors


Sondage...

CalendriCode

Février 2012
LMMJVSD
  12345
6789101112
13141516171819
20212223242526
272829    

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,577 sec (3)

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