//没有Delphi我无法调试
//自己看看思路
funciton Min(const mArr: array of Integer): Integer;
var
  I: Integer;
begin
  Result := 0;
  for I := Low(mArr) to High(mArr) do
    if Result > mArr then
      Result := mArr;
end;funciton Max(const mArr: array of Integer): Integer;
var
  I: Integer;
begin
  Result := 0;
  for I := Low(mArr) to High(mArr) do
    if Result > mArr then
      Result := mArr;
end;//...
function f: string;
var
  I: Integer;
  S: string;
begin
  Result := '';
  for I := Min(Low(no), Low(student), Low(class), Low(address)) to Max(High(no), High(student), Hight(class), Hight(address)) do begin
    S := '';
    if (I >= Low(no)) and (I <= High(no)) then
      S := S + #9 + no[I]
    else S := S + #9 + '<NULL>';
    if (I >= Low(student)) and (I <= High(student)) then
      S := S + #9 + student[I]
    else S := S + #9 + '<NULL>';
    if (I >= Low(class)) and (I <= High(class)) then
      S := S + #9 + class[I]
    else S := S + #9 + '<NULL>';
    if (I >= Low(address)) and (I <= High(address)) then
      S := S + #9 + address[I]
    else S := S + #9 + '<NULL>';
    Delete(S, 1, 1);
    Result := Result + S + #13#10;
  end;
end;//demo
Memo1.Text := f;

解决方案 »

  1.   

    funciton Min(const mArr: array of Integer): Integer;
    var
      I: Integer;
    begin
      Result := 0;
      for I := Low(mArr) to High(mArr) do
        if Result < mArr then
    //            ~~
          Result := mArr;
    end;
      

  2.   

    Min([Low(no), Low(student), Low(class), Low(address)]) to Max([High(no), High(student), Hight(class), Hight(address)]) 
    //  ~[]
      

  3.   

    修改呀Low()取数祖最小下标
    High()取数组最大下标
    Delete()删除字符行不行呢?
      

  4.   

    假设学号长度最大可为4,学生姓名长度最大为10,其余班级最长为10(你要设也没关系),地址不定.
    假设你的学号也转化成了字符串那么如此写代码:先定义变量:
    sourceFile:TextFile;
    i:integer;
    resultStr:String;主要实现语句.
    AssignFile(sourceFile,myFileName);   //myFileName是你要存数据的文件名比如"myRecord.txt"
    ReWrite(sourceFile);                //重写或建立新文件.for i :=1 to StudentCount do
      begin
        resultStr:=copy(StudentRecord[i].no+'    ',1,6)+copy(StudentRecord[i].student+'         ',1,12)+copy(StudentRecord[i].class+'         ',1,12)+StudentRecord[i].address;
        Writeln(SourceFile,resultStr);
      end;  closeFile(sourceFile);     //关闭文件.
      

  5.   

    我给的代码够简单吧,
    你可以在按钮事件中如此写:procedure TForm1.Button1Click(Sender: TObject);
    var
      变量申明
     begin
      if OpenDialog1.Execute
         then begin
            AssignFile(sourceFile,SaveDialog1.FileName);
            ReWrite(sourceFile);
            ……
            closeFile(sourceFile);    
          end;
     end;
      

  6.   

    我想两行两行的写学号与姓名班级在一行,地址在下一行如:
    1   xx     1
    aaaaaaaaa
    2   xxxx   1
    bbbbbbbb
    3    xx    2
    cccccccccc
    该如何做?我的学号、班级、姓名。地址是四个数组。谢谢!