PC SOFT

GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEVWEBDEV e WINDEV Mobile

Inicio → WINDEV 25 → WD RepeatString (Function) - Repetições
WD RepeatString (Function) - Repetições
Iniciado por amarildo, mar., 05 2015 9:02 AM - Sem resposta
Membro registado
535 mensagems
Popularité : +14 (14 votes)
Publicado em março, 05 2015 - 9:02 AM
http://windevdesenvolvimento.blogspot.com.br/2015/03/windev-repeatstring-function-repeticoes.html

Dat_hora_solici is string = 20150304154034
Q is int = 17 - Length(Dat_hora_solici)
Info("Q =>"+Q)
//Total de Tamanho que tem de ter = 17
//Q=vai diminuir 17 - tamanho do que foi recebido = que vai dar 3
Info("Q =>"+Dat_hora_solici)
Dat_hora_solici = Dat_hora_solici + RepeatString("0", Q)
//Vai preencher com 0 o restante
//Resultado Abaixo
//20150304154034 -> ANTES
//20150304154034000 -> DEPOIS
Info("Q =>"+Dat_hora_solici)


res is string
res = RepeatString("x", 4) // RETORNA "xxxx"
Info(" X , 4" + res)
res = RepeatString("EU", 5) // RETORNA EUEUEUEUEU
Info(" EU , 5" + res)
res = RepeatString("ZERO", 2) // RETORNA ZEROZERO
Info(" ZERO ,2" + res)
res = RepeatString("UM", 0) // RETORNA EM BRANCO
Info(" UM , 0" + res)