浅谈Visual Basic编程在土木工程学习中的应用
2012-03-23贺永坤陈宇张涛
贺永坤 陈宇 张涛
摘要:随着社会的发展和科学技术的进步,人们对于各行各业从业人员的能力要求不断提高,对于土木人也不例外。为了实现建筑结构的安全、实用、美观、经济、精准,土木人对计算机的依赖也越来越大。因此,身为学习土木工程的在校学生,了解和掌握计算机技术是非常重要的,尤其是计算机编程。本文中,笔者将以计算机编程中的Visual Basic编程(简称VB编程)为例浅谈计算机编程在土木工程学习中的应用。
关键词:VB编程土木工程学习 应用 浅谈
Abstract: with the development of society and the progress of science and technology, people in all walks of life from personnel of ability constantly increasing demand, for civil are no exception. In order to realize the safety of structures, practical, beautiful, economy, accurate, to the computer's dependence on civil engineering are getting more and more serious. Therefore, as a study of civil engineering in the school student, understand and master the computer technology is very important, especially in computer programming. This paper, the author will with computer programming of the Visual Basic programming (hereinafter referred to as VB programming) as an example on computer programming in civil engineering application of learning.
Keywords: VB programming civil engineering study on application
中图分类号: TP313文献标识码:A 文章编号
1.引言
VB(Visual Basic)是微软推出的基于Windows环境的软件开发工具。它的主要特点为:1)、可视化;2)、面向对象;3)、采用事件驱动的编程模式;4)、结构化程序设计语言。其编程过程中主要应用的是窗体(Form)和几种基本的控件,如命令按钮(Command)、标签(Label)和文本框(Text)并对其进行编程控制。在应用VB编程之前,首先分析问题,确定程序要完成什么任务,然后按下面的步骤创建应用程序:
1)、新建工程,并在工程中添加窗体
2)、设计窗体界面
3)、设置对象的属性
4)、编写程序代码
5)、运行、调试程序(重复3、4、5步)
6)、保存工程、窗体文件
7)、编译程序,产生EXE文件
VB编程是几种计算机程序中较为易学的一种,也是为大多数在校大学生所掌握的一种计算机编程。它的应用十分广泛,四则运算计算器、体彩模拟器、红绿灯系统及俄罗斯方块等小游戏都可以通过VB编程加以实现。基于它简单易学、方便实用的特点,我们可以将它应用到我们的日常学习当中,用程序语言去诠释我们的想法,解决难题。……
