当前位置:首页 » 编程博文
开发技术指南» 文章正文
    引言: 1、"&"替换"+"在很多人的编程语言中,用“+”来连接字符串,这样容易导致歧义。
 

 

 ·sam初识+sam详解    »显示摘要«
    摘要:sam是什么? 也许大家在网上看了许多的关于sam的传奇的故事吧!那么今天就让我----偏执狂带你们进入sam的所有吧! 第一节:初级认识sam 微软做了两个不同的系统骨架,一个叫win32,我们用的win9x/me系统就附在它上面;另一个叫nt(new technology),也就是winnt/2000/xp/2003的骨架。不过很不幸,微软有点“偏心”......
    摘要:using system;using system.security;using system.security.cryptography;using system.io;using system.text; namespace mysecurity{public class mysecurity { public mysecurity() { // // todo: 在此处添加构造函数逻辑 /......


VB编程的8个小技巧
1."&"替换"+"

在很多人的编程语言中,用“+”来连接字符串,这样容易导致歧义.良好的习惯是用“&”来连接字符串. 【程序编程相关:Delphi7 从子线程中发送消息到主线

【推荐阅读:框架(javascript)

【扩展信息:网络设备数据采集程序simplenet介

不正确:

dim smessage as string

smessage = "1" + "2"

正确:

dim smessage as string

smessage = "1" & "2"

注意:"&"的后面有个空格

2.变量命名大小写,语句错落有秩,源代码维护方面

下面大家比较一下以下两段代码:

读懂难度很大的代码:

dim sname as string

dim nturn as integer

if nturn = 0 then

if sname = "vbeden" then

do while nturn < 4

nturn = nturn + 1

loop

end if

end if

容易读懂的代码:

dim sname as string

dim nturn as integer

if nturn = 0 then

  if sname = "vbeden" then

   do while nturn < 4

     nturn = nturn + 1

   loop

  end if

end if

3请养成以下的“对象命名约定”良好习惯

推荐使用的控件前缀

控件类型 前缀 例子

3d panel pnl pnlgroup

ado data ado adobiblio

animated button ani animailbox

check box chk chkreadonly

combo box, drop-down list box cbo cboenglish

command button cmd cmdexit

common dialog dlg dlgfileopen

communications com comfax

control (当特定类型未知时,在过程中所使用的) ctr ctrcurrent

data dat datbiblio

data-bound combo box dbcbo dbcbolanguage


...   下一页
 ·在jsp页面上打印错误堆栈    »显示摘要«
    摘要:try{....................}catch(exception e){ //定义一个流 bytearrayoutputstream ostr = new bytearrayoutputstream(); //把错误堆栈储存到流中 e.printstacktrace(new printstream(ostr)); //打印.... out.println(ostr.tostring......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE