Visual Basic 6 Naming Standards (转)

VB6命名规范
本文介绍了Visual Basic 6.0中推荐的对象和变量命名规范。这些规范有助于提高代码的可读性和理解性,并确保遵循标准实践。
Visual Basic 6 Naming Standards (转)[@more@]

This contains the microsoft Recommended naming conventions for objects, and Variables in Visual Basic 6.0.

 

Why is this here? I believe it is always important to follow some standard when coding, and if your job involves vb programming, then I'm sure you will agree that it definitely makes code easier to read and understand.  Most if not all, IT jobs will require you to follow a set of standards while writing your code. 

The Visual Basic Coding standards have changed over the years but they are still about the same, with the SCOpe and Type identifiers to tell if a variable is global, module or local, and what the data type of the variable is.  I remember the previous set of standards used only a single character type identifier. (most of the code in this site still uses the old standard, I just have not caught on to the new one yet.) The new standard of the 3 character type identifier makes VB's standards more like that of Visual C++. (I doubt this is coincidence.)

   

Visual Basic Naming Standards Control type prefix Example 3D Panel pnl pnlGroup ADO Data ado adoBiblio Animated button ani ani MailBox Check box chk chkReadOnly Combo box, drop-down list box cbo cboEnglish Command button cmd cmdExit Common dialog dlg dlgFileOpen Communications com comFax Control (used within procedures when the specific type is unknown) ctr ctrCurrent Data dat datBiblio Data-bound combo box dbcbo dbcboLanguage Data-bound grid dbgrd dbgrdQueryResult Data-bound list box dblst dblstJobType Data combo dbc dbcAuthor Data grid dgd dgdTitles Data list dbl dblPublisher Data repeater drp drpLocation Date picker dtp dtpPublished Directory list box dir dir source Drive list box drv drvTarget File list box fil filSource Flat scroll bar fsb fsbMove Form frm frmEntry Frame fra fraLanguage Gauge gau gauStatus Graph gra graRevenue Grid grd grdPrices Hierarchical flexgrid flex flexOrders Horizontal scroll bar hsb hsbVolume Image img imgIcon Image combo imgcbo imgcboProduct ImageList ils ilsAllIcons Label lbl lblHelpMessage Lightweight check box lwchk lwchkArchive Lightweight combo box lwcbo lwcboGerman Lightweight command button lwcmd lwcmdRemove Lightweight frame lwfra lwfraSaveOptions Lightweight horizontal scroll bar lwhsb lwhsbVolume Lightweight list box lwlst lwlstCostCenters Lightweight option button lwopt lwoptIncomeLevel Lightweight text box lwtxt lwoptStreet Lightweight vertical scroll bar lwvsb lwvsbYear Line lin linVertical List box lst lstPolicyCodes ListView lvw lvwHeadings M api message mpm mpmSentMessage MAPI session mps mpsSession MCI mci mciVideo Menu mnu mnuFileOpen Month view mvw mvwPeriod MS Chart ch chSalesbyRegion MS Flex grid msg msgClients MS Tab mst mstFirst OLE container ole oleWorksheet Option button opt optGender Picture box pic picVGA Picture clip clp clpToolbar ProgressBar prg prgLoadFile Remote Data rd rdTitles RichTextBox rtf rtfReport Shape shp shpCircle Slider sld sldScale Spin spn spnPages Stat usbar sta staDateTime SysInfo sys sysMonitor TabStrip tab tabOptions Text box txt txtLastName Timer tmr tmrAlarm Toolbar tlb tlbActions TreeView tre treOrganization UpDown upd updDirection Vertical scroll bar vsb vsbRate

 

  Variable Naming Conventions

Visual Basic uses a Scope and Type identifier to prefix each variable name, so it is easy to tell the data type of the variable and where the variable is declared. The Scope can be one of three things:

Scope Prefix Example Global g gstrUserName Module-level m mblnCalcInProgress Local to procedure None dblVelocity

The Type identifier follows the Scope identifier and will enable anyone looking at your code to instantly know the data type of all your variables without having to look for the variables declaration. The following is a list of the data types and their prefixes:

Data type Prefix Example Boolean bln blnFound Byte byt bytRasterData Collection object col colWidgets Currency cur curRevenue Date (Time) dtm dtmStart Double dbl dblTolerance Error err errOrderNum Integer int intQuantity Long lng lngDistance Object obj objCurrent Single sng sngAverage String str strFName User-defined type udt udtEmployee Variant vnt vntCheckSum

So if you had a global variable named "Counter" and it is a long, you would name the variable "glngCounter" Anyone looking at this variable would instantly know the variable is global to the whole project and would know it is a long. In a multi-developer environment this type of standard is a must, or else there will be considerable time lost while each developer keeps referring to the variable declarations.


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10752043/viewspace-992345/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/10752043/viewspace-992345/

内容概要:本文介绍了基于贝叶斯优化的CNN-LSTM混合神经网络在时间序列预测中的应用,并提供了完整的Matlab代码实现。该模型结合了卷积神经网络(CNN)在特征提取方面的优势与长短期记忆网络(LSTM)在处理时序依赖问题上的强大能力,形成一种高效的混合预测架构。通过贝叶斯优化算法自动调参,提升了模型的预测精度与泛化能力,适用于风电、光伏、负荷、交通流等多种复杂非线性系统的预测任务。文中还展示了模型训练流程、参数优化机制及实际预测效果分析,突出其在科研与工程应用中的实用性。; 适合人群:具备一定机器学习基基于贝叶斯优化CNN-LSTM混合神经网络预测(Matlab代码实现)础和Matlab编程经验的高校研究生、科研人员及从事预测建模的工程技术人员,尤其适合关注深度学习与智能优化算法结合应用的研究者。; 使用场景及目标:①解决各类时间序列预测问题,如能源出力预测、电力负荷预测、环境数据预测等;②学习如何将CNN-LSTM模型与贝叶斯优化相结合,提升模型性能;③掌握Matlab环境下深度学习模型搭建与超参数自动优化的技术路线。; 阅读建议:建议读者结合提供的Matlab代码进行实践操作,重点关注贝叶斯优化模块与混合神经网络结构的设计逻辑,通过调整数据集和参数加深对模型工作机制的理解,同时可将其框架迁移至其他预测场景中验证效果。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值