Creating menu in Foxpro for DOS

This is an example of simple navigation menu programming in Foxpro 2.6

  1. set talk off
  2. set stat off
  3. set scor off
  4. set cent on
  5. set date brit
  6. do whil .t.
  7. clea
  8. @5,20 to 19,45 doub
  9. @6,25 say "MAIN MENU"
  10. @7,21 to 7,44 doub
  11. k=0
  12. @ 9,25 prompt "DATA ENTRY"
  13. @11,25 prompt "REPORT PRINTING"
  14. @13,25 prompt "PROCESS"
  15. @15,25 prompt "EXIT"
  16. @17,25 prompt "QUIT to SYSTEM"
  17. menu to k
  18. do case
  19. case k=1
  20. do dataent
  21. case k=2
  22. do repoprn
  23. case k=3
  24. * do proces
  25. case k=4
  26. exit
  27. case k=5
  28. clos all
  29. clea all
  30. quit
  31. otherwise
  32. loop
  33. endcase
  34. enddo
  35. clos all
  36. clea all
  37.  
  38.  
  39.  
  40. proce dataent
  41. do whil .t.
  42. clea
  43. @5,20 to 19,55 doub
  44. @6,30 say "DATA ENTRY MENU"
  45. @7,21 to 7,54
  46. k1=0
  47. @ 9,25 prompt "1. STUDENT"
  48. @11,25 prompt "2. STAFF"
  49. @13,25 prompt "3. FEES "
  50. @15,25 prompt "4. COURSES"
  51. @17,25 prompt "RETURN TO MAINMENU"
  52. menu to k1
  53. do case
  54. case k1=1
  55. do stud
  56. case k1=2
  57. do staff
  58. case k1=3
  59. do fees
  60. case k1=4
  61. do course
  62. case k1=5
  63. exit
  64. otherwise
  65. loop
  66. endcase
  67. enddo
  68. clos all
  69. return
  70.  
  71. proce repoprn
  72. do whil .t.
  73. clea
  74. @5,20 to 19,55 doub
  75. @6,30 say "REPORT MENU"
  76. @7,21 to 7,54
  77. k1=0
  78. @ 9,25 prompt "Report 1"
  79. @11,25 prompt "Report 2"
  80. @13,25 prompt "Report 3"
  81. @15,25 prompt "Report 4"
  82. @17,25 prompt "Return to Mainmenu"
  83. menu to k2
  84. do case
  85. case k2=1
  86. do fmainprn
  87. case k2=2
  88. do fothrprn
  89. case k2=3
  90. do mainprn
  91. case k2=4
  92. do othrprn
  93. case k2=5
  94. exit
  95. otherwise
  96. loop
  97. endcase
  98. enddo
  99. clos all
  100. return

Recommended :

FoxPro e-Book
  1. FoxPro Programming Quick Reference e-Book (New! Revised Edition)