谁帮我看看这段代码对不对? 返回数组类型的函数
程序代码:
function TForm5.returnArray(mmView: TMemo):arResult; var nArMy,nMmLine,x,j,k,i:Integer; arMy:array of Integer; begin x:= mmView.Lines.Count-1; while (x>0) and (mmView.Lines.Strings[x]='' )and (mmView.Lines.Strings[x-2]<>'') do begin mmView.Lines.Delete(x); Dec(x); end; if mmView.Lines.Strings[mmView.Lines.Count-1]<>'GO' then mmView.Lines.Add('GO'); for nMmLine := 0 to mmView.Lines.Count - 1 do begin if AnsiSameText(Trim(mmView.Lines.Strings[nMmLine]),'GO') then begin SetLength(arMy, Length(arMy) + 1);//把GO的行号副给数组 arMy[Length(arMy)-1]:= nMmLine; end; end; for i := 0 to Length(arMy) - 1 do Result[i]:=arMy[i]; end;顺便问下,有人说是在参数中返回,小弟不解。。。 以前学过JAVA,貌似差别很大啊