Welcome to LEAD Support Forum Login | Register | Faq  

    LEAD Support Forum
  Resource to find answers and post technical questions about LEAD products.
Search    
   

Re: [Error] Unit1.pas(126): Undeclared identifier: 'CMNT_LAST'
Started by erhan at 05-31-2008 5:41. Topic has 2 replies.

Print Search « Previous Thread Next Thread »
  05-31-2008, 5:41
erhan is not online. Last active: 6/2/2008 2:46:24 PM erhan

Not Ranked
Joined on 05-31-2008
Posts 1
[Error] Unit1.pas(126): Undeclared identifier: 'CMNT_LAST'
Reply Quote
Hi I tried Lead tool free eval. 14.5 but check sample code on delphi 6 it gives error How can i solve this problem :| . Code is show below
-------------------------------------------------
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Menus, LEADTwain, LEADDlgService, LEADDlgFile, ExtCtrls,
LEADMain, StdCtrls, LEADDicom;


procedure TForm1.Button4Click(Sender: TObject);
var
Empty: Variant; { For clearing comments }
MyCommentText: string; { String for CMNT_SZDESC }
NewCommentText: string; { String for CMNT_SZDESC that we read }
FilePath: string; { File to be updated }
i: Integer; { Counter }
nRet: Integer;
begin
{ Specify the file that we will update. }
FilePath := 'C:\Images\5.dcm';
{ Specify the Empty variant for clearing comments. }
VarClear(Empty);
{ Get all of the current comments from the file. }
{ Temporarily disable method errors so that we do not fail when comments are missing. }
LeadImage1.EnableMethodErrors := False;
for i := 0 to CMNT_LAST do
begin
LeadImage1.Comment[i] := Empty;
LeadImage1.Comment[i] := LeadImage1.ReadComment(FilePath, 0, i);
end;
LeadImage1.EnableMethodErrors := True;
{ Load and modify the image. }
nRet:= LeadImage1.Load(FilePath, 0, 0, 1);
if(nRet = SUCCESS)then
begin
LeadImage1.Reverse();
{ Update the CMNT_SZDESC comment. }
MyCommentText := CHR(13) + 'This image has been reversed.';
LeadImage1.Comment[CMNT_SZDESC] := LeadImage1.Comment[CMNT_SZDESC] + MyCommentText;
{ Save the file and read the comment that we saved. }
LeadImage1.Save(FilePath, FILE_TIF, LeadImage1.BitmapBits, 0, SAVE_OVERWRITE);
NewCommentText := LeadImage1.ReadComment(FilePath, 0, CMNT_SZDESC);
{ Display the message. }
Application.MessageBox(PChar(NewCommentText), 'File Comments', mb_OK);
{ Clear the comments from memory. }
for i := 0 To CMNT_LAST do
LeadImage1.Comment[i] := Empty;
end;
end;
   Report 
  06-01-2008, 10:20
Qasem Lubani is not online. Last active: 11/25/2008 3:28:58 PM Qasem Lubani



Top 10 Posts
Joined on 08-13-2006
Posts 1,147
Re: [Error] Unit1.pas(126): Undeclared identifier: 'CMNT_LAST'
Reply Quote
At the beginning of the Unit1 file, add LEADDef to the uses section
Qasem Al-Lubani
LEAD Technical Support
www.leadtools.com
   Report 
  06-01-2008, 10:21
Qasem Lubani is not online. Last active: 11/25/2008 3:28:58 PM Qasem Lubani



Top 10 Posts
Joined on 08-13-2006
Posts 1,147
Re: [Error] Unit1.pas(126): Undeclared identifier: 'CMNT_LAST'
Reply Quote
At the beginning of the Unit1 file, add LEADDef to the uses section
Qasem Al-Lubani
LEAD Technical Support
www.leadtools.com
   Report 
Post
LEAD Support Fo... » General » Example Request... » Re: [Error] Unit1.pas(126): Undeclared identifier: 'CMNT_LAST'

Powered by Community Server, by Telligent Systems