Function NoName6();
Begin
IndexID:='SH000300';
Endt:=20190321T;
sEndt:=datetostr(Endt);
echo sEndt;//打印变量值
//返回子函数执行完时所有中间变量的值
stocks:=DebugRunEnvdo getStocksTest(IndexID,Endt);
//运行到此时,输出所有中间变量的值,1输出结果中包括系统参数,0则不包括
DebugRunEnv(1);
data:=select sEndt as '截止日',*,spec(close(),['代码']) as '现价'
from stocks end;
return data;
End;
function getStocksTest(id,t); //选出PE最大的五支票
begin
//打印
echo '当前程序:',functionname(),' 指数:',id,' 日期:',datetostr(t);
bk:=getbkbydate(id,t);
peS:=select thisrow as '代码',spec(stockpe(t,0),thisrow) as 'PE' from bk end;
reS:=select *,thisorder as '排名' from peS order by ['PE'] desc end;
reS:=select * from reS where ['排名']<=5 end;
return reS;
end
//返回四个结果框
运行信息:
Noname6:getstockstest:
Noname6: DebugRunEnv(1)返回的结果
Function NoName7();
Begin
IndexID:='SH000300';
Endt:=20190321T;
sEndt:=datetostr(Endt);
stocks:=getStocksTest(IndexID,Endt);
data:=select sEndt as '截止日',*,spec(close(),['代码']) as '现价'
from stocks end;
return data; //正常情况下程序到这里结束,并返回data
End;
function getStocksTest(id,t); //选出PE最大的五支票
begin
bk:=getbkbydate(id,t);
peS:=select thisrow as '代码',spec(stockpe(t,0),thisrow) as 'PE' from bk end;
reS:=select *,thisorder as '排名' from peS order by ['PE'] desc end;
reS:=select * from reS where ['排名']<=5 end;
debugreturn reS;//有这一句,则整个程序到这里结束,并返回reS
return reS;
end
//返回