循环结构:
函数: 【程序编程相关:Peer-to-Peer (P2P) c】
for,do...while,while,foreach...in 【推荐阅读:为blog添加在页面直接显示访问数的计数】
【扩展信息:ORACLE函数大全】
<return type> <function name> (<optional parameters>) {//code;};
按值传递参数:<return type> <function name> (<optional parameters>) {//code;};
按引用传递参数:<return type> <function name> (ref <optional parameters>) {//code;}; 而且在函数调用中也要加上ref关键字.
输出参数
其值在调用之前没有设置,在代码运行时设置,可以在以后使用;对被调用的函数来说,这样的参数是只写的.在c#中,这样的参数称谓输出参数,在参数定义与参数调用中使用out关键字来声明.
<%@ page language="c#" contenttype="text/html" responseencoding="gb2312" %>
<script runat="server">string setnumber(out int number1)
{number1=25;
return "ok";}void page_load()
{
int a;
string returnvalue=setnumber(out a);
message.text=a.tostring();
message.text+="<br/>"+returnvalue;
}
</script>
<body> <asp:label id="message" runat="server" /></body>变量的作用域:
局部变量:
块级变量:
全局变量:
... 下一页