28 lines
786 B
Text
28 lines
786 B
Text
uses console
|
|
|
|
sub CaracteresUnicos (cad as string)
|
|
int i, j, lngt
|
|
lngt = len(cad)
|
|
printl "String = " chr(34) & cad & chr(34) ", length = " lngt
|
|
for i = 1 to lngt
|
|
for j = i + 1 to lngt
|
|
if mid(cad,i,1) = mid(cad,j,1) then
|
|
printl " First difference at position " & i & _
|
|
" and " & j & ", character = '" & mid(cad,i,1) & _
|
|
"', hex value = " & hex(asc(mid(cad,i,1)))
|
|
printl
|
|
exit sub
|
|
end if
|
|
next j
|
|
next i
|
|
printl " All characters are the same." cr
|
|
end sub
|
|
|
|
CaracteresUnicos ("")
|
|
CaracteresUnicos (".")
|
|
CaracteresUnicos ("abcABC")
|
|
CaracteresUnicos ("XYZ ZYX")
|
|
CaracteresUnicos ("1234567890ABCDEFGHIJKLMN0PQRSTUVWXYZ")
|
|
|
|
printl cr "Enter ..."
|
|
waitkey
|