Solved

won't compile shane

Posted on 2004-04-22
38
488 Views
Last Modified: 2010-05-18
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.
0
Comment
Question by:magma_george
  • 19
  • 19
38 Comments
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10895551
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
 

Author Comment

by:magma_george
ID: 10895607
well what about LoadFromResource not being defined and the var c

0
 

Author Comment

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

[Error] LogCall.pas(73): Undeclared identifier: 'LoadFromResource'
0
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10895654
C: Integer

Shane
0
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10895657
Error] LogCall.pas(62): Type expected but 'BEGIN' found

is becasue there was no type for C

C: Integer;


Shane
0
 

Author Comment

by:magma_george
ID: 10895684
what about this

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

that has to be defined somehow no


how would i define it


0
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10895725
try adding Buttons to your uses

uses ......., Buttons;

SHane
0
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10895729
I dont have a copy of the program - so i can't compile and test


Shane

0
 

Author Comment

by:magma_george
ID: 10895747
well check your e(mail) i will send the form


do you agree
0
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10895755


Did you add Buttons?

SHane
0
 

Author Comment

by:magma_george
ID: 10895806
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
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10895810
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
 

Author Comment

by:magma_george
ID: 10895817
and how owuld i assign the LoadFromResource to it

0
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10895828
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
 

Author Comment

by:magma_george
ID: 10895830
i added the buttons to the uses clause but it is still giving that message

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

Expert Comment

by:shaneholmes
ID: 10895836
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
 

Author Comment

by:magma_george
ID: 10895838
[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
 

Author Comment

by:magma_george
ID: 10895844
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
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10895850
Change each of these

  Glyph.LoadFromResource('ADD');

 to these

 Glyph.LoadFromResourceName(HInstance, 'ADD');

Shane
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 11

Expert Comment

by:shaneholmes
ID: 10895857
Forget sending it now, im getting ready to go to bed - its 11:00 PM here

Shane
0
 

Author Comment

by:magma_george
ID: 10895871
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
 

Author Comment

by:magma_george
ID: 10895891
[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
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10895893
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
 

Author Comment

by:magma_george
ID: 10895915
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
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10895919
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
 

Author Comment

by:magma_george
ID: 10895942
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
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10895959
Close evrything down - including delphi

Restart and reload and recomile


Shane
0
 

Author Comment

by:magma_george
ID: 10895963
and also [Error]     File DBImages.RES resource kept; file DBImages.RES resource discarded.
0
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10895966
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
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10895977
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
 

Author Comment

by:magma_george
ID: 10895996
i did restart everyhing and it is still doing the same


the same error messages

0
 

Author Comment

by:magma_george
ID: 10896008
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
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10896012
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
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10896017
EMAIL IT NOW!

0
 
LVL 11

Accepted Solution

by:
shaneholmes earned 500 total points
ID: 10896018
EMAIL IT NOW!

0
 

Author Comment

by:magma_george
ID: 10896049
mailed it to you
0
 

Author Comment

by:magma_george
ID: 10896092
did you get it
0
 

Author Comment

by:magma_george
ID: 10896125
i ain't getting anything form you

are you there
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now