主要功能:面积计算,条件查询。虽然第一次写GIS的二次开发程序,不过感觉上手真的很快。也就是用了1个半小时,就把大概的知识点过了一遍,接着就开始对着Mapbasic开始敲键盘。不过毕竟没有基础,写出来的程序很丑陋(不会basic语言,所以很多东西写得特别长)在此把代码贴出,希望路过的朋友,可以看看。nclude""Include""declareSub道路declareSub高薪产业区declareSub工业发展用地declareSub教育科研用地declareSub居住用地declareSub绿地declareSub行政办公用地declareSub文化娱乐用地declareSub面积DeclareSubduihuaDeclareSubMainDeclareSubtiaojianDimmianjiasFloatDimiasIntegerDimmianji1asfloatDimzongmianji1asfloatDimjilushuasIntegerSubMainCreateMenu"条件查询"as"请输入条件"CallingtiaojianAlterMenuBarAdd"条件查询"CreateMenu"统计查询"as"面积"CallingduihuaAlterMenuBarAdd"统计查询"CreateMenu"分类查询"as"道路"Calling道路,"高薪产业区"Calling高薪产业区,"工业发展用地"Calling工业发展用地,"教育科研用地"Calling教育科研用地,"居住用地"Calling居住用地,"绿地"Calling绿地,"行政办公用地"Calling行政办公用地,"文化娱乐用地"Calling文化娱乐用地AlterMenuBarAdd"分类查询"EndSubSubtiaojianDimyongdileixingasStringDimxiao,daasIntegerDialogTitle"条件查询"ControlStaticTextIntoyongdileixingControlStaticTextTitle"查询的用地类型"ControlEditTextIntoyongdileixingControlStaticTextTitle"面积的最小值"ControlEditTextIntoxiaoControlStaticTextTitle"面积的最大值"ControlEditTextIntodaControlOkButtonTitle"确定"ControlCancelButtonTitle"取消"OpenTable"c:\shix\"+yongdileixingIfyongdileixing="教育科研用地"ThenFetchFirstFrom教育科研用地DoWhileNotEOT(教育科研用地)mianji=Area(,"sqkm")mandInfo(CMD_INFO_DLG_OK)ThenIfmianji>=xiaoandmianji<=daTheni=i+1Print"教育科研用地id:"+i+"面积:"+Str$(mianji)EndIfElsePrint"没有您要搜索的对象名称"EndIfFetchNextFrom教育科研用地LoopEndIfIfyongdile
开发范例-小白 来自淘豆网m.daumloan.com转载请标明出处.