Link to home
Start Free TrialLog in
Avatar of magma_george
magma_george

asked on

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.
Avatar of shaneholmes
shaneholmes

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;
Avatar of magma_george

ASKER

well what about LoadFromResource not being defined and the var c

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

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

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

is becasue there was no type for C

C: Integer;


Shane
what about this

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

that has to be defined somehow no


how would i define it


try adding Buttons to your uses

uses ......., Buttons;

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


Shane

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


do you agree


Did you add Buttons?

SHane
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

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
and how owuld i assign the LoadFromResource to it

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
i added the buttons to the uses clause but it is still giving that message

[Error] LogCall.pas(74): Undeclared identifier: 'LoadFromResource'
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
[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'
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


Change each of these

  Glyph.LoadFromResource('ADD');

 to these

 Glyph.LoadFromResourceName(HInstance, 'ADD');

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

Shane
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)

[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
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
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:
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
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..
Close evrything down - including delphi

Restart and reload and recomile


Shane
and also [Error]     File DBImages.RES resource kept; file DBImages.RES resource discarded.
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
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
i did restart everyhing and it is still doing the same


the same error messages

well it complied just the stuff doesn't work it doesn't convert the old buttons into

the new images

thanks it compiles though
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
EMAIL IT NOW!

ASKER CERTIFIED SOLUTION
Avatar of shaneholmes
shaneholmes

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
mailed it to you
did you get it
i ain't getting anything form you

are you there