EXEMPLO DA FUNÇÃO STRINGDIFF( X, Y) BY BOLLER
x,y is int
x = CBOX_teste..Count
gsresultadoantes = ""
LOOP(x)
y++
IF CBOX_teste[y] = True
gsresultadoantes += "1"
ELSE
gsresultadoantes += "0"
END
END
x,y is int
x = CBOX_teste..Count
gsResultadodepois = ""
LOOP(x)
y++
IF CBOX_teste[y] =True
gsResultadodepois += "1"
ELSE
gsResultadodepois += "0"
END
END
EXEMPLO DA FUNÇÃO STRINGDIFF( X, Y) BY BOLLER
//EVENT IN BUTTON COMPARE
Procedure StringDiff(ValorAnterior, ValorPosterior)
x, nDiff is int
sDiff is string
nQtde is int = Length(ValorAnterior)
IF Length(ValorAnterior) = Length(ValorPosterior) THEN
LOOP(nQtde)
x++
IF Middle(ValorAnterior,x,1) <> Middle(ValorPosterior,x,1) THEN
nDiff = x
sDiff = Middle(ValorAnterior,x,1) +"<>"+ Middle(ValorPosterior,x,1)
END
END
ELSE
ToastDisplay("Tamanho diferente das strings, assim é impossivel comparar, são diferentes mesmo!")
END
arrayResultado is array of string
Add(arrayResultado,nDiff)
Add(arrayResultado,sDiff)
RESULT arrayResultado
arrResultCompare is array of string = StringDiff(gsresultadoantes, gsResultadodepois)
Info(arrResultCompare[1])
Info(arrResultCompare[2])
--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/Mensagem modificada, novembro, 08 2019 - 9:04 PM