兰
兰铃子
Unregistered / Unconfirmed
GUEST, unregistred user!
function SaveRecord(k:integer):boolean;<br>var i,j:integer;<br>begin<br>try<br> for i:=0 to k-1 do<br> begin<br> Randomize;<br> j:=random(k);<br> while temparray[j]='' then<br> begin<br> j:=j+1;<br> end;<br> with query do<br> begin<br> SQL.clear;<br> sql.add('insert into temp');<br> sql.add('(select * from 试题表 where id =''+temparray[j]+''')')<br> ExecSQL;<br> end;<br> temparray[j]:<br>end;<br>except<br> result:=false;<br> exit;<br>end;<br>result:=true;<br>end;<br>出错提示是[Error] Unit6.pas(32): Statement expected but 'FUNCTION' found<br>[Error] Unit6.pas(40): Undeclared identifier: 'temparray'<br><br><br>怎么回事啊!帮帮忙哦!<br>