#1
  1. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    May 2002
    Location
    UK
    Posts
    563
    Rep Power
    13

    checking line string number in a DLL


    I have an app which reads strings from a file processes it in a DLL before showing the output. The problem I have is that the information is kept over to lines and I need the DLL to recognise which line it is reading from.

    So the DLL is as follows
    Code:
    library collexconv;
    
    uses
      ShareMem,
      SysUtils,
      Classes;
    
    {$R *.res}
    Function GrpNum (S: String): String; stdcall;
    begin
    Result := copy(S,1,1);
    if  Result = 'G' then  begin
    Result := copy(S,2,5);
    Result := StringReplace(Result, ' ', '', [rfReplaceAll]); // is on line 1
    end
    else
    Result := '';
    end;
    Function StartNum (S: String): String; stdcall;
    begin
    Result := copy(S,1,1);
    if  Result = 'A' then  begin
    Result := copy(S,2,5);
    Result := StringReplace(Result, ' ', '', [rfReplaceAll]); // Is on line 2
    end
    else
    Result := '';
    end;
    
    exports
    GrpNum, StartNum;
    end.
    and the app is
    Code:
    Uses
    ShareMem;
    Function GrpNum (S: String): String; stdcall; external 'collexconv.dll';
    Function StartNum (S: String): String; stdcall; external 'collexconv.dll';
    
    type
    .........
    ........
    .........
    
    sl.LoadFromFile(CdrImportEdit.Text);
        //loop though each line of text
        for i := 0 to sl.count - 1 do
        begin
          group_no := GrpNum(sl[i]);
          start_no := StartNum(sl[i]);
         end;
    I assume that in the app I can set an integer var, so that it is either line 0 or 1, but I then need to pass that info to the DLL so it can check it is reading the correct line.
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2004
    Posts
    14
    Rep Power
    0
    I can't understand!!!
    what you want realy!!

IMN logo majestic logo threadwatch logo seochat tools logo