won't compile shane

unit LogCall;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, DBCtrls, StdCtrls, Mask, DB, ComCtrls;

type
  TFrame1 = class(TFrame)
    GroupBox1: TGroupBox;
    Label2: TLabel;
    DBEdit2: TDBEdit;
    DBCheckBox1: TDBCheckBox;
    Label3: TLabel;
    DBEdit3: TDBEdit;
    DBCheckBox2: TDBCheckBox;
    DBCheckBox3: TDBCheckBox;
    Label5: TLabel;
    DBEdit5: TDBEdit;
    Label6: TLabel;
    DBEdit6: TDBEdit;
    Label7: TLabel;
    DBEdit7: TDBEdit;
    Label8: TLabel;
    DBEdit8: TDBEdit;
    Label9: TLabel;
    DBEdit9: TDBEdit;
    Label10: TLabel;
    DBEdit10: TDBEdit;
    Label1: TLabel;
    DBEdit1: TDBEdit;
    Label12: TLabel;
    DBEdit12: TDBEdit;
    DBNavigator1: TDBNavigator;
    Label4: TLabel;
    DBEdit4: TDBEdit;
    DataSource1: TDataSource;
    ListBox1: TListBox;
    DateTimePicker1: TDateTimePicker;
    procedure FormActivate(Sender: TObject);
    procedure DBEdit8DblClick(Sender: TObject);
    procedure DBEdit8Exit(Sender: TObject);
    procedure DateTimePicker1Change(Sender: TObject);
    procedure FrameEnter(Sender: TObject);
  private
    { Private declarations }
  public
    WhichScreen: string;
    { Public declarations }
  end;

implementation

uses DispModule, lookupcust, Deliveries;

{$R *.dfm}
{$R DBImages.RES}

procedure TFrame1.FormActivate(Sender: TObject);
var c:

begin
with DBNavigator1 do
    for c := 0 to ControlCount -1 do
      if Controls[c] is TNavButton then
        with TNavButton(Controls[c]) do
        begin
          Glyph := nil;
          Font.Style := [fsBold];
          case TNavigateBtn(c) of
            nbInsert :begin
                           Caption := 'Add';
                           Glyph.LoadFromResource('ADD');
                          end;
            nbDelete : begin
                             Caption := 'Delete';
                             Glyph.LoadFromResource('DELETE');
                            end;

            nbPost   :begin
                           Caption := 'Post';
                            Glyph.LoadFromResource('POST');
                          end;
            nbCancel :begin
                            Caption := 'Remove';
                           Glyph.LoadFromResource('REMOVE');
                           end;
         end;

procedure TFrame1.DBEdit8DblClick(Sender: TObject);
begin
   WhichScreen := 'Delivery';
   with DataModule3 do
   begin
       if not CusLookup.prepared
       then
          CusLookup.prepare;
          CusLookup.ParamByName('Name').AsString := dbedit8.text+'%';
        try
          CusLookup.Open;
        except
          abort;
       end;
       form5.Show;
   end;
end;

procedure TFrame1.DBEdit8Exit(Sender: TObject);
var
    LookupName: string;
    LookupAddr1: string;
    LookupAddr2: string;
    LookupCustno: smallint;
    LookupCity: string;
    LookupPhone: string;
begin
 //need to do a customer lookup based on name
 With DataModule3 do
 begin
    //if (form2.Edit1.Text = cOldName) and
    //   (DispQueryCustno.Value <> 0) then
    //    abort;

    if not (DestQuery.State in [dsEdit, dsInsert]) then
        DestQuery.Edit;
    CusLookup.close;               {Deactivate the query as a precaution }
    if not CusLookup.prepared
    then
      CusLookup.prepare;           {Make sure the query is prepared}
      CusLookup.ParamByName('Name').AsString := dbedit8.text+'%';
      try
        CusLookup.Open;
    except
      abort;
    end;
    if CusLookup.Eof then
    begin
         CusLookup.Close;
         form5.Show;
    end
    else
    begin
        // Save First record
        LookupCustNo := CusLookup.Fields[0].AsInteger;
        LookupName  :=  CusLookup.Fields[1].Value;
        LookupAddr1 := CusLookup.Fields[2].Value;
        LookupAddr2 := CusLookup.Fields[3].Value;
        LookupCity := CusLookup.Fields[4].Value;
        LookupPhone := CusLookup.Fields[5].value;
        CusLookup.Next;
        if CusLookup.EOF then
        begin
            destquerycustno.value := LookupCustNo;
            dbedit8.text := LookupName;
            dbedit9.text := LookupAddr1;
        end;
        if not CusLookup.Eof then
        begin
            CusLookup.Close;
            form5.Show;
        end;
   end;
   //LogCall.Refresh;
   CusLookup.close;
   //ActiveControl := dbedit9;
 end;
end;

procedure TFrame1.DateTimePicker1Change(Sender: TObject);
begin
with DataModule3 do
    begin
       if not (DispQuery.State in [dsEdit, dsInsert]) then
           DestQuery.Edit;
       DestQuerydel_date.Value :=  DateTimePicker1.Date;
    end;
end;

procedure TFrame1.FrameEnter(Sender: TObject);
begin
with DataModule3 do
    begin
        DateTimePicker1.ShowCheckbox := true;
        DateTimePicker1.datetime := DestQuerydel_date.Value;
        if DestQuerydel_time_am.Value = true then
            ListBox1.Selected[0] := true
        else
            ListBox1.selected[1] := true;

    end;
end;

end.
magma_georgeAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
shaneholmesConnect With a Mentor Commented:
EMAIL IT NOW!

0
 
shaneholmesCommented:
First of all, your missing a few "ends" at the end of the event:

Shane

procedure TFrame1.FormActivate(Sender: TObject);
var c:
begin
with DBNavigator1 do
    for c := 0 to ControlCount -1 do
      if Controls[c] is TNavButton then
        with TNavButton(Controls[c]) do
        begin
          Glyph := nil;
          Font.Style := [fsBold];
          case TNavigateBtn(c) of
            nbInsert :begin
                           Caption := 'Add';
                           Glyph.LoadFromResource('ADD');
                          end;
            nbDelete : begin
                             Caption := 'Delete';
                             Glyph.LoadFromResource('DELETE');
                            end;

            nbPost   :begin
                           Caption := 'Post';
                            Glyph.LoadFromResource('POST');
                          end;
            nbCancel :begin
                            Caption := 'Remove';
                           Glyph.LoadFromResource('REMOVE');
                           end;
    end;//case
   end; //with TNavButton(Controls[c]) do
end;
0
 
magma_georgeAuthor Commented:
well what about LoadFromResource not being defined and the var c

0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
magma_georgeAuthor Commented:
[Error] LogCall.pas(62): Type expected but 'BEGIN' found

[Error] LogCall.pas(73): Undeclared identifier: 'LoadFromResource'
0
 
shaneholmesCommented:
C: Integer

Shane
0
 
shaneholmesCommented:
Error] LogCall.pas(62): Type expected but 'BEGIN' found

is becasue there was no type for C

C: Integer;


Shane
0
 
magma_georgeAuthor Commented:
what about this

[Error] LogCall.pas(74): Undeclared identifier: 'LoadFromResource'

that has to be defined somehow no


how would i define it


0
 
shaneholmesCommented:
try adding Buttons to your uses

uses ......., Buttons;

SHane
0
 
shaneholmesCommented:
I dont have a copy of the program - so i can't compile and test


Shane

0
 
magma_georgeAuthor Commented:
well check your e(mail) i will send the form


do you agree
0
 
shaneholmesCommented:


Did you add Buttons?

SHane
0
 
magma_georgeAuthor Commented:
no

what type of button would i add

what would i add for the LoadFromResource

i don't know and how to assign it

can you explain a bit more

0
 
shaneholmesCommented:
ADD BUTTONS TO YOUR USES CLAUSE

Like this.....

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, DBCtrls, StdCtrls, Mask, DB, ComCtrls, Buttons;



Shane
0
 
magma_georgeAuthor Commented:
and how owuld i assign the LoadFromResource to it

0
 
shaneholmesCommented:
YOu don't,

When you get an error that states "Undeclared identifier"

it means you are missing a Unit, which in this case, ,ight be BUTTONS!


Shane
0
 
magma_georgeAuthor Commented:
i added the buttons to the uses clause but it is still giving that message

[Error] LogCall.pas(74): Undeclared identifier: 'LoadFromResource'
0
 
shaneholmesCommented:
See, this is what i mean about wasting my time:


Comment from magma_george
Date: 04/22/2004 07:33PM PDT
 Author Comment  

well check your e(mail) i will send the form
 



It is now 7:55 PST, 22 minutes after you said you would mail the program and I have recived nothing.

Goodnight!

Shane
0
 
magma_georgeAuthor Commented:
[Error] LogCall.pas(92): Statement expected but 'PROCEDURE' found

that is also another message i am getting

[Fatal Error] Disp.dpr(20): Could not compile used unit 'LogCall.pas'
0
 
magma_georgeAuthor Commented:
well i asked if you agreed with me to send you an e-mail

but you haven't said anything

so what ami supposed to guess

i will send it if you want


0
 
shaneholmesCommented:
Change each of these

  Glyph.LoadFromResource('ADD');

 to these

 Glyph.LoadFromResourceName(HInstance, 'ADD');

Shane
0
 
shaneholmesCommented:
Forget sending it now, im getting ready to go to bed - its 11:00 PM here

Shane
0
 
magma_georgeAuthor Commented:
you really fixed the problem with the
Glyph.LoadFromResourceName(HInstance, 'ADD');

but i still get thses error

[Hint] MainDisp.pas(98): Private symbol 'Bookmark' declared but never used

[Error] RLINK32: Error reading file "C:\disp\DBImages.RES"(that is the path of the resource file it is correct)

0
 
magma_georgeAuthor Commented:
[Error]   Type RC_BITMAP, ID ADD:
[Error]     File DBImages.RES resource kept; file DBImages.RES resource discarded.
[Error]   Type RC_BITMAP, ID DELETE:
[Error]     File DBImages.RES resource kept; file DBImages.RES resource discarded.
[Error]   Type RC_BITMAP, ID POST:

etc

that is the lates error message
0
 
shaneholmesCommented:
This is a hint, it does not stop you from compiling:

[ Hint] MainDisp.pas(98): Private symbol 'Bookmark' declared but never used

it means you have declared the variable, but you never use it...


Error] RLINK32: Error reading file "C:\disp\DBImages.RES"(that is the path of the resource file it is correct)

well, its either not there, or its damaged


Shane
0
 
magma_georgeAuthor Commented:
well i replaced that file with the same one but which was stored in the  diffrent place and

than i am encountering these

[Error] WARNING. Duplicate resource(s):

[Error]   Type RC_BITMAP, ID ADD:
[Error]     File DBImages.RES resource kept; file DBImages.RES resource discarded.
[Error]   Type RC_BITMAP, ID DELETE:
[Error]     File DBImages.RES resource kept; file DBImages.RES resource discarded.
[Error]   Type RC_BITMAP, ID POST:
0
 
shaneholmesCommented:
use image editor to open that file to see if you can see the bitmaps in it...

remember image editor? I explained it was part of delphi, in the \bin directory, or on you rprograms menu

Shane
0
 
magma_georgeAuthor Commented:
yes i can view them in the image editor and when i go F9

it shows me the same error message

[Error] WARNING. Duplicate resource(s):

[Error]   Type RC_BITMAP, ID ADD:
[Error]     File DBImages.RES resource kept; file DBImages.RES resource discarded.
[Error]   Type RC_BITMAP, ID DELETE:
[Error]     File DBImages.RES resource kept; file DBImages.RES resource discarded.
[Error]   Type RC_BITMAP, ID POST:
etc..
0
 
shaneholmesCommented:
Close evrything down - including delphi

Restart and reload and recomile


Shane
0
 
magma_georgeAuthor Commented:
and also [Error]     File DBImages.RES resource kept; file DBImages.RES resource discarded.
0
 
shaneholmesCommented:
check every source file in your project

Make sure you dont have another instance of this:

{$R DBImages.RES}


including in your project source, as well as all units

Should be only in your main form's unit - thats it!

Shane
0
 
shaneholmesCommented:
I have no idea what you have done, You got me baffled

anyway, im going to bed - its late, and I got know where with you all night.....


Goodnight  magma_george.

Shane
0
 
magma_georgeAuthor Commented:
i did restart everyhing and it is still doing the same


the same error messages

0
 
magma_georgeAuthor Commented:
well it complied just the stuff doesn't work it doesn't convert the old buttons into

the new images

thanks it compiles though
0
 
shaneholmesCommented:
K, hurry, cause i aint got all night - zip it and email it NOW!
If it isn't here in 3 minutes im going to bed!

Shane
0
 
shaneholmesCommented:
EMAIL IT NOW!

0
 
magma_georgeAuthor Commented:
mailed it to you
0
 
magma_georgeAuthor Commented:
did you get it
0
 
magma_georgeAuthor Commented:
i ain't getting anything form you

are you there
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.