|
Inicio → WINDEV 25 → WX (Windev, Webdev e Windev Mobile) - Válida número de Telefone e Celular |
WX (Windev, Webdev e Windev Mobile) - Válida número de Telefone e Celular |
Iniciado por Boller, 18,mar. 2021 21:22 - No hay respuesta |
| |
| | | |
|
| |
Miembro registrado 4.549 mensajes |
|
Publicado el 18,marzo 2021 - 21:22 |
Procedure validarFone(sTelefone is string) IF sTelefone = "" THEN RESULT True END IF sTelefone[[01 TO 05]] = "00000" THEN RESULT False END IF sTelefone[[1]] = "0" THEN sTelefone = sTelefone[[02 TO ]] END sFone2, sCadeia is string sCadeia = "0123456789" nIDX is int = 0
FOR i = 1 TO 16 IF Contains(sCadeia,sTelefone[[i]]) THEN nIDX++ sFone2[[nIDX]]=sTelefone[[i]] END END
IF Length(sFone2) < 8 THEN RESULT False END
IF sFone2[[01 TO 04]] = "0800" OR sFone2[[01 TO 04]] = "0300" THEN sTelefone = sFone2[[01 TO 04]] + " " + sFone2[[05 TO 06]] + " " + sFone2[[07 TO ]] RESULT True END
IF Length(sFone2) < 10 THEN IF Length(sFone2) = 8 THEN sTelefone = "(00) " + Left(sFone2,4) + "-" + Right(sFone2,4) RESULT True END sTelefone = "(00) " + Left(sFone2,1) + " " + Middle(sFone2,2,4) + "-" + Right(sFone2,4) RESULT True END
IF Length(sFone2) = 10 THEN sTelefone = "(" + Left(sFone2,2) + ") " + Middle(sFone2,3,4) + "-" + Right(sFone2,4) RESULT True END
sTelefone = "(" + Left(sFone2,2) + ") " + Middle(sFone2,3,1) + " " + Middle(sFone2,4,4) + "-" + Right(sFone2,4) RESULT True
-- Adriano José Boller ______________________________________________ Consultor e Representante Oficial da PcSoft no Brasil +55 (41) 99949 1800 adrianoboller@gmail.com skype: adrianoboller http://wxinformatica.com.br/ |
| |
| |
| | | |
|
| | | | |
| | |
|