J
Jack
Hello,
Under is C procedure:
#include<stdio.h>
#include<conio.h>
void ab(int x)
{
if(x<5)
{
ab(x+1);
printf("%d ",x);
}
}
void main(void)
{
ab(1);
getch();
}
Under is ASP procedure:
<SCRIPT Language=JavaScript runat=server>
var a;
abc(0);
function abc(b)
{
abc.prototype.x=b+1;
if(abc.prototype.x<5)
{
abc(abc.prototype.x);
Response.Write(abc.prototype.x);
Response.Write(" ");
}
else
return;
}
</SCRIPT>
Run the C procedure shows "4 3 2 1 ",but load the ASP's procedure shows "5 5
5 5 ".
I want a JavaScript function like C function.That is to say,I want a varible
which in the function is static.
Thank you
Under is C procedure:
#include<stdio.h>
#include<conio.h>
void ab(int x)
{
if(x<5)
{
ab(x+1);
printf("%d ",x);
}
}
void main(void)
{
ab(1);
getch();
}
Under is ASP procedure:
<SCRIPT Language=JavaScript runat=server>
var a;
abc(0);
function abc(b)
{
abc.prototype.x=b+1;
if(abc.prototype.x<5)
{
abc(abc.prototype.x);
Response.Write(abc.prototype.x);
Response.Write(" ");
}
else
return;
}
</SCRIPT>
Run the C procedure shows "4 3 2 1 ",but load the ASP's procedure shows "5 5
5 5 ".
I want a JavaScript function like C function.That is to say,I want a varible
which in the function is static.
Thank you