vb 6.0 谁能帮忙解释下

[复制链接]
查看11 | 回复4 | 2011-10-30 10:38:12 | 显示全部楼层 |阅读模式
PrivateSubcmdprocess_click()\'callthesubroutinetoprocessthestudentproceossstudentEndSubSubprocessstudent()DimbresultAsBoolean\'callcheckidfunctiontovalidateanidbresult=checkid(3)Ifbresult=TrueThenMsgBox\"studenthasbeenprocessedsucessfully.\"EndIfEndSubFunctioncheckid(iidAsInteger)AsBoolean\'ifidislessthan0,itisinvalidIfiid0Then\'returnfalsecheckid=FalseElse\'allotheridsarevalid\'returntruecheckid=TrueEndIfEndFunction
回复

使用道具 举报

千问 | 2011-10-30 10:38:12 | 显示全部楼层
PrivateSubcmdprocess_click,根据命名可能是个cmd调用程序,写在按钮的click事件下\'callthesubroutinetoprocessthestudent’注释语句不做解释proceossstudent’是下面的子过程Subprocessstudent()DimbresultAsBoolean‘定义一个布尔型的bresult变量\'callcheckidfunctiontovalidateanidbresult=checkid(3)布尔型的bresult的值为checkid(3),一开始以为是一个ckeckbox组,后来才发现是个函数。Ifbresult=TrueThen‘当bresult的值为true时,弹出警告框MsgBox\"studenthasbeenprocessedsucessfully.\"EndIfFunctioncheckid(iidAsInteger)AsBoolean’这个就是前面的checkid函数返回值,类型为布尔型,参数为integer型的iid。当iid为正整数时,返回true;负数时,返回false\'ifidislessthan0,itisinvalidIfiid0Then\'returnfalsecheckid=FalseElse\'allotheridsarevalid\'returntruecheckid=TrueEndIfEndFunction程序中的注释好像是要完成的步骤,不做解释
回复

使用道具 举报

千问 | 2011-10-30 10:38:12 | 显示全部楼层
要和form结合一起才好理解祝你顺利吧赞同
回复

使用道具 举报

千问 | 2011-10-30 10:38:12 | 显示全部楼层
checkid(iidAsInteger)是用来判断iid是否大于零,如果大于等于零,checkid为真(true),如果小于零,checkid为假(false)。processstudent()过称是完成对\"3\"的判断,如果当iid为3时,checkid是真的,就显示一个对话框---msgbox,这个msgbox上还有一行字“studenthasbeenprocessedsucessfully”。如果是假的,就什么也不做。cmdprocess_click()里的就是指当按钮cmdprocess被按下是会调用processstudent这个过程赞同
回复

使用道具 举报

千问 | 2011-10-30 10:38:12 | 显示全部楼层
当单击名字叫cmdprocess的按钮后执行proceossstudent过程proceossstudent过程大意是如果bresult等于ture时就弹出提示学生处理完成checkid过程大意是判断id是否为正数如果iid小于0时checkid等于flase否则等于ture希望对你有帮助,望采纳!!赞同
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行