Advertisement
Guest User

Untitled

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