Advertisement
sabdas4869

delete fix

Nov 20th, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. func menuDelete(){
  2. var found bool
  3. var key string
  4. var x int
  5.  
  6. i =0
  7. fmt.Print("Input nama sekolah yang yang akan dihapus: ")
  8. fmt.Scan(&key)
  9. found=false
  10. for i<tot && found==false{
  11. if key==tab[i].sekul{
  12. //fmt.Println(tab[i].sekul)
  13. tab[i].status=0
  14. found=true
  15. }
  16.  
  17. i++
  18. }
  19. if found==true{
  20. fmt.Println( " Apakah anda yakin akan menghapus data ini ? \n1.Ya \n2.Tidak")
  21. fmt.Scan(&x)
  22. if x==1{
  23.  
  24. fmt.Println("Data berhasil dihapus")
  25. for tab[i].status!=0 && i<tot{
  26. if tab[i].status==1{
  27. fmt.Println(tab[i])
  28.  
  29. }
  30. i++
  31. }
  32.  
  33. menuUtama()
  34. }else if x==2 {
  35. menuUtama()
  36. }
  37. }else if found==false{
  38. fmt.Println("not found")
  39. menuUtama()
  40. }
  41. CallClear()
  42.  
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement