Posted By

Angelboy on 09/23/10


Tagged


Versions (?)

Vl64 seperar modulo


 / Published in: Visual Basic
 

  1. Public Function vl64separar(datos As String, arreglo As Integer) As String
  2. Dim i As Long
  3. Dim j As Long
  4. Dim Encontro As String
  5. Dim cadena() As String
  6.  
  7. j = -1
  8. For i = 1 To Len(datos)
  9.  
  10. ReDim Preserve cadena(0 To Len(datos))
  11.  
  12.  
  13. 'Un digito
  14. If Asc(Mid(datos, i, 1)) >= 72 And Asc(Mid(datos, i, 1)) <= 79 Then
  15. Encontro = Mid(datos, i, 1)
  16. j = j + 1
  17. cadena(j) = Encontro
  18. End If
  19.  
  20. 'dos digitos
  21. If Asc(Mid(datos, i, 1)) >= 80 And Asc(Mid(datos, i, 1)) <= 87 Then
  22. Encontro = Mid(datos, i, 2)
  23. j = j + 1
  24. cadena(j) = Encontro
  25. i = i + 1
  26. End If
  27.  
  28. 'tres digitos
  29. If Asc(Mid(datos, i, 1)) >= 88 And Asc(Mid(datos, i, 1)) <= 95 Then
  30. Encontro = Mid(datos, i, 3)
  31. j = j + 1
  32. cadena(j) = Encontro
  33. i = i + 2
  34. End If
  35.  
  36. 'cuatro digitos
  37. If Asc(Mid(datos, i, 1)) >= 96 And Asc(Mid(datos, i, 1)) <= 103 Then
  38. Encontro = Mid(datos, i, 4)
  39. j = j + 1
  40. cadena(j) = Encontro
  41. i = i + 3
  42. End If
  43.  
  44. 'cinco digitos
  45. If Asc(Mid(datos, i, 1)) >= 104 And Asc(Mid(datos, i, 1)) <= 111 Then
  46. Encontro = Mid(datos, i, 5)
  47. j = j + 1
  48. cadena(j) = Encontro
  49. i = i + 4
  50. End If
  51.  
  52. 'seis digitos
  53. If Asc(Mid(datos, i, 1)) >= 112 And Asc(Mid(datos, i, 1)) <= 119 Then
  54. Encontro = Mid(datos, i, 6)
  55. j = j + 1
  56. cadena(j) = Encontro
  57. i = i + 5
  58. End If
  59.  
  60. Next
  61.  
  62. vl64separar = cadena(arreglo)
  63. End Function

Report this snippet  

You need to login to post a comment.