alguien me puede indicar a que es debido que no elimine los espacios en blanco con ALLTRIM
- Code: Select all Expand view
- #include "FiveWin.ch"
function Main()
LOCAL m := 0
LOCAL n := 0
LOCAL s := ""
LOCAL sInt := 0
LOCAL c := ""
LOCAL k := 0
LOCAL GenSerial := ""
LOCAL ch := '888888'
LOCAL num := 0
GenSerial := ALLTRIM("MT" + SUBSTR(ch, 1, 1) + SUBSTR(ch, 6, 1))
c := CHR(MOD(VAL(SUBSTR(ch, 4, 3)), 26) + 65)
k := ASC(c)
For m = 1 To 3
For n = 1 To 2
s := ""
c := CHR(MOD(VAL(ch) + k, 26) + 65)
If n = 2
k := k + VAL(SUBSTR(ch, m + 2, 1))
s := s + c
GenSerial := ALLTRIM(GenSerial + s)
End If
k := ASC(c)
num := k * VAL(SUBSTR(ch, m + 1, 1))
sInt := INT(MOD(num, 10))
If sInt > 4
sInt := sInt - 5
Else
sInt := sInt + 5
EndIf
GenSerial := ALLTRIM(GenSerial + STR(sInt))
ENDFOR
ENDFOR
MsgInfo(GenSerial)
return nil
Muchas gracias.
Saludos