|
WX - Procedure Picture( ) e NoPicture( ) |
Iniciado por Boller, 28,ago. 2015 20:47 - 2 respuestas |
| |
| | | |
|
| |
Miembro registrado 4.520 mensajes |
|
Publicado el 28,agosto 2015 - 20:47 |
Procedure Picture(valor, formato)
NewFormat is string = ""
Zeros is string = ""
IF valor <> "" AND formato <> "" AND Length(valor) > 0
NewValor is string = valor
Tamanho is int = Length(formato)
IF valor <> "" AND formato <> "" AND Length(valor) < Length(formato) AND PositionOccurrence(formato,"0",firstRank,FromBeginning) > 0 AND PositionOccurrence(formato,".",firstRank,FromBeginning) = 0 AND PositionOccurrence(formato,"-",firstRank,FromBeginning) = 0 AND PositionOccurrence(formato,"/",firstRank,FromBeginning) = 0
NewFormat = NumToString(Val(NewValor), "0"+Tamanho+".0f")
ELSE IF valor <> "" AND formato <> "" AND PositionOccurrence(formato,"0",firstRank,FromBeginning) = 0
IF Length(valor) < Length(NoPicture(formato)) THEN Diferenca is int = Length(NoPicture(formato)) - Length(valor) LOOP (Diferenca) Zeros += "0" END NewValor = Zeros +""+ valor END
Pos01 is int = 0 Pos02 is int = 0 Total is int = Length(formato)
LOOP (Total)
Pos01 += 1
IF formato[[Pos01]] = 9 THEN Pos02 += 1 NewFormat += Middle(NewValor,Pos02,1) ELSE NewFormat += Middle(formato,Pos01,1) END
END
END
ELSE NewFormat = valor END
RESULT(NewFormat) |
| |
| |
| | | |
|
| | |
| |
Miembro registrado 4.520 mensajes |
|
Publicado el 28,agosto 2015 - 20:48 |
Procedure NoPicture(valor)
NewFormat is string = valor
NewFormat = Replace(NewFormat,"(","") NewFormat = Replace(NewFormat,")","") NewFormat = Replace(NewFormat,"[","") NewFormat = Replace(NewFormat,"]","") NewFormat = Replace(NewFormat,"{","") NewFormat = Replace(NewFormat,"}","") NewFormat = Replace(NewFormat,"/","") NewFormat = Replace(NewFormat,"\","") NewFormat = Replace(NewFormat,".","") NewFormat = Replace(NewFormat,",","") NewFormat = Replace(NewFormat,";","") NewFormat = Replace(NewFormat,":","") NewFormat = Replace(NewFormat,"_","") NewFormat = Replace(NewFormat,"-","") NewFormat = Replace(NewFormat,"+","") NewFormat = Replace(NewFormat," ","") NewFormat = Replace(NewFormat," ","") NewFormat = NoSpace(NewFormat) NewFormat = NoAccent(NewFormat)
RESULT(NewFormat) |
| |
| |
| | | |
|
| | |
| |
Miembro registrado 4.520 mensajes |
|
Publicado el 28,agosto 2015 - 20:48 |
| |
| |
| | | |
|
| | | | |
| | |
|