Advertisement
Guest User

Untitled

a guest
Jun 3rd, 2019
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Include "MAPBASIC.def"
  2. 'Include "MENU.def"'
  3.  
  4. Declare Sub Main
  5. Declare Sub show_pop_sub
  6. Declare Sub find_state_sub
  7. Declare Sub quit_sub
  8.  
  9. Global pop as Integer
  10. Global stateName as String
  11.  
  12.  
  13. Sub Main
  14.   Create Menu "Menu" As    
  15.         "Pop of man"     Calling show_pop_sub,
  16.     "find state"          Calling find_state_sub,
  17.         "End"                                  Calling quit_sub
  18.   Alter Menu Bar Add "Menu"
  19. End Sub
  20.  
  21. Sub show_pop_sub
  22.     Dialog
  23.         Title "man pop in state"
  24.         Control StaticText
  25.             Title "Enter mans:"
  26.         Control EditText
  27.             Into pop
  28.         Control OKButton
  29.         Control CancelButton
  30.     Open Table "E:\study\ОГеоТех\GIS\MAPINFO\DATA\TUT_DATA\TUT_USA\USA\STATES.TAB" Interactive
  31.     select STATES.State_Name,STATES.Pop_Male  from STATES where (STATES.Pop_Male > pop)
  32. end sub
  33.  
  34. Sub find_state_sub
  35.     Dialog
  36.         Title "state"
  37.         Control StaticText
  38.             Title "Enter stateName:"
  39.         Control EditText
  40.             Into stateName
  41.         Control OKButton
  42.         Control CancelButton
  43.     Open Table "E:\study\ОГеоТех\GIS\MAPINFO\DATA\TUT_DATA\TUT_USA\USA\STATES.TAB" Interactive
  44.     select * from STATES where STATES.State_Name = stateName
  45.     dim buffer_75_km As Object
  46.     Fetch First From Selection
  47.     buffer_75_km = Buffer(Selection.obj, 75, 150, "km")
  48.     Insert Into WindowInfo(FrontWindow(), 10)(OBJ) Values(buffer_75_km)
  49.  
  50. End Sub
  51.  
  52. Sub quit_sub
  53.     Alter Menu Bar Remove "Menu"
  54.     end program
  55. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement