Type para
    ib As String * 5
    lw As String * 5
    ix As String * 5
    Xformat As Single
    Ybase   As Single  'Store Yminimal
    xpoint  As Single
    xcount  As Single
    xincre  As Single
    xorigin As Single
    xrefer  As Single
    yincre  As Single
    yorigin As Single
    yrefer  As Single
End Type                          Dim locf As Long, lf As Long, fpa As para
    LOCATE 1, 1: Print "Loading..."
    Open Fselec$ For Binary As #1
    Get #1, , fcondtn
    i = 0
    locf = 65
    lf = LOF(1) - 200
    Do
        Seek #1, locf
        Get #1, , fpa                                //主要还是这句的意思。
        If fpa.Xformat <> 2 Then CLS: Print "STOP! (Xformat<>2)": Stop如果要转为delphi,应该是怎么写呢?谢谢!

解决方案 »

  1.   

    para=record
            ib:array[0..4] of char;
            lw:array[0..4] of char;
            ix:array[0..4] of char;
            Xformat : Single;
            Ybase   : Single;
            xpoint  : Single;
            xcount  : Single;
            xincre  : Single;
            xorigin : Single;
            xrefer  : Single;
            yincre  : Single;
            yorigin : Single;
            yrefer  : Single;
        end;  Get #1, , fpa     //////////
        FileRead(iFileHandle,fpa,sizeof(para));
      

  2.   

    补充:
    Type condtn
        cdn As String * 50
        date As String * 10
        hd As String * 4
    End Type
    我是这么转的,但是有点问题。
    type
     TCondtn=Class
      Cdn:string;
      Date:string;
      Hd:string;
     end;
     Tpara=class
        ib:string;
        lw:string;
        ix:string;
        Xformat:single
        Ybase:single
        xpoint:single
        xcount:single
        xincre:single
        xorigin:single
        xrefer:single
        yincre:single
        yorigin:single
        yrefer:single
      End;  procedure GetPara;
    var
     locf:longint;
     lf:longint;
     fpa:tpara;
     FCondtn:TCondtn;
     Fselec:textFile;
     I:integer;
    begin
     Asignfile(FSelec,'D:\33.dsd');
     reset(FSelec); 
     Read(FSelec,FCondtn);                //这句有问题,不知道是不是这么写
     I:=0;
     LOcf:=65;
     Lf:=Filesize(FSelec)-200;
     while locf < lf do
     begin
      Seek(FSelec,Locf);
      read(FSelec,FPa);                 //这句有问题,不知道是不是这么写       
     end; 
    end;      请知道的指导一下         
      

  3.   

    谢谢!seek是用Fileseek替换吗?
      

  4.   

    是的。
    FileSeek(iFileHandle,Locf,0);
      

  5.   

    谢谢!还有个问题:lf = LOF(1) - 200 表示为什么?
      

  6.   

    LOF(1):这个是VB的函数,表示把文件打开,并用1做别名,函数的意义是取得文件的长度
      

  7.   

    是用filesize(),来表示的吧。在delphi中,哪个函数相当VB中的asc的功能(返回一个 Integer,代表字符串中首字母的字符代码。)
      

  8.   

    label1.Caption:=inttostr(Byte(PChar('test')^));