猿问

VB中Function函数?

VB中Function函数


蓝山帝景
浏览 837回答 1
1回答

守候你守候我

function关键字指定一个函数/过程可以返回特定值,如:public Function YourNeed(Param as integer)as integer..............Yourneed=100End Function过程在最后返回100的值,如调用a=YourNeed(10),则a=100。而sub过程则无法返回值,如:public sub YourNeed(Param as integer)..............Yourneed=100'此处语句虽然存在,但无效End sub在其它过程调用sub Yourneed过程时,如a=Yourneed(100)编译器则报错。
随时随地看视频慕课网APP
我要回答