Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2012-04

File not found.

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Dave Coventry

Hi,

I have a unit called extractdwg.pas which contains the following code.

~~~~~~~~~~~~~~~~~~ 8< ~~~~~~~~~~~~~~~~~~~~~
unit extractdwg;
interface

uses
Classes, Forms, SysUtils,Dialogs,
dwgsFunctions,dwgglobals,

  Controls;
procedure StartExtract(DWGFilename: string);
var
    BinFile: file;
implementation
uses Unit1;
procedure StartExtract(DWGFilename: string);
var i,j: integer;
    binfile: File;
   longBuff: ^integer;
begin
     Screen.Cursor:=crHourGlass;
     AssignFile(BinFile, DWGFilename);
     Filemode:=0;
     Reset(BinFile,1);
     Seek(BinFile,21);
     ....
     ....
end;
~~~~~~~~~~~~~~~~~~ 8< ~~~~~~~~~~~~~~~~~~~~~

This is called from unit1:

  with OpenDialog1 do
  if Execute then
  begin
    StartExtract(FileName);
  end;

I select a file /home/dave/Documents/ACAD/4m2.dwg (no spaces). The file name is correctly passed to StartExtract(DWGFilename) but the program stops with the error message "Project raised exception class 'ElnOutError' with message: File not found.

Reply by email

Dave Coventry
to leledumbo

The DWGFilename is reported correctly as /home/dave/Documents/ACAD/4m2.dwg

This code has worked previously, certainly in Delphi 3, and I'm reasonably sure in Lazarus, too; I was just wondering if there had been any changes in Lazarus which might have broken it. I last worked on it in 2006/2007.

In the meantime I tried to upgrade to the latest SVN, but appear to have broken Lazarus. :+(

leledumbo wrote 12 lines
ElnOutError due to file not found should print out the filename. Is it "/home/dave/Documents/ACAD/4m2.dwg" or "" or even nothing at all? -- View this message in context: http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-File-not-found-tp3909198p3909550.html Sent from the Free Pascal - Lazarus mailing list . -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Mattias Gaertner
to Dave Coventry: I have a unit called extractdwg.pas which contains the following code. ~~~~~~~~~~~~~~~~~~…
Show quoted text 45 lines
Hi, I have a unit called extractdwg.pas which contains the following code. ~~~~~~~~~~~~~~~~~~ 8< ~~~~~~~~~~~~~~~~~~~~~ unit extractdwg; interface uses Classes, Forms, SysUtils,Dialogs, dwgsFunctions,dwgglobals, Controls; procedure StartExtract(DWGFilename: string); var BinFile: file; implementation uses Unit1; procedure StartExtract(DWGFilename: string); var i,j: integer; binfile: File; longBuff: ^integer; begin Screen.Cursor:=crHourGlass; AssignFile(BinFile, DWGFilename); Filemode:=0; Reset(BinFile,1); Seek(BinFile,21); .... .... end; ~~~~~~~~~~~~~~~~~~ 8< ~~~~~~~~~~~~~~~~~~~~~ This is called from unit1: with OpenDialog1 do if Execute then begin StartExtract(FileName); end;

Should work.

I select a file /home/dave/Documents/ACAD/4m2.dwg (no spaces). The file name is correctly passed to StartExtract(DWGFilename) but the program stops with the error message "Project raised exception class 'ElnOutError' with message: File not found.

On which line stops the debugger?

Mattias

Reply by email