Advertisement
DevMakoto

Binaria_Secuencial_BD

Nov 28th, 2015
425
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1.  
  2. dato_ap_pat = space(10)
  3. input "ingresa apellido paterno""; dato_ap_pat
  4. Use alumno.DBF
  5. Go Top
  6. inicial = Recno()
  7. Go Bottom
  8. final = Recno()
  9. central = ENT((inicial+final)/2)
  10. go central
  11. dato_central = ap_pat
  12. while ( dato_ap_pat <> dato_central ) and ( inicial < final )
  13. if Dato_Central < dato_ap_pat
  14. inicial = central + 1
  15. else
  16. final = central - 1
  17. endif
  18. central = ENT((inicial+final)/2)
  19. go central
  20. dato_central = ap_pat
  21. endwhile
  22. if dato_ap_pat = dato_central
  23. gotoxy (1,1) print cod_alu
  24. gotoxy (2,1) print ap_pat
  25. gotoxy (3,1) print nombre
  26. codigo_alu = cod_alu
  27. endif
  28.  
  29. Exit alumno.DBF
  30.  
  31. Use notas.DBF
  32. Go Top
  33. while ( not notas.eof() )
  34. if codigo_alu = cod_alu
  35.  
  36. codigo_curso = cod_cur
  37. codigo_carrera = cod_carrera
  38. codigo_profesor = cod_prof
  39. nota_curso = nota
  40.  
  41. Use curso.DBF
  42. Go Top
  43. while ( not curso.eof() )
  44. if codigo_curso = cod_cur
  45. nombre_curso = nom_cur
  46. ciclo_curso = ciclo
  47. break
  48. else
  49. skip
  50. endif
  51. endwhile
  52. Exit curso.DBF
  53.  
  54. Use carrera.DBF
  55. Go Top
  56. while ( not carrera.eof() )
  57. if codigo_carrera = cod_carrera
  58. nombre_facultad = facultad
  59. nombre_carrera = nom_carrera
  60. break
  61. else
  62. skip
  63. endif
  64. endwhile
  65. Exit carrera.DBF
  66.  
  67. Use profesor.DBF
  68. Go Top
  69. while ( not profesor.eof() )
  70. if codigo_profesor = cod_prof
  71. nombre_profesor = nombre
  72. apellido_profesor = ap_prof
  73. break
  74. else
  75. skip
  76. endif
  77. endwhile
  78. Exit profesor.DBF
  79.  
  80. gotoxy (5 + i, 1) print codigo_curso
  81. gotoxy (5 + i, 5) print nombre_curso
  82. gotoxy (5 + i, 15) print ciclo_curso
  83. gotoxy (5 + i, 25) print nombre_facultad
  84. gotoxy (5 + i, 30) print nombre_carrera
  85. gotoxy (5 + i, 40) print apellido_profesor,nombre_profesor
  86. gotoxy (5 + i, 50) print nota_curso
  87.  
  88. i = i + 1
  89. Skip
  90. else
  91. Skip
  92. endif
  93. endwhile
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement