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(Send er: 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(Sende r: 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('AD D');
end;
nbDelete : begin
Caption := 'Delete';
Glyph.LoadFromResource('DE LETE');
end;
nbPost :begin
Caption := 'Post';
Glyph.LoadFromResource('PO ST');
end;
nbCancel :begin
Caption := 'Remove';
Glyph.LoadFromResource('RE MOVE');
end;
end;
procedure TFrame1.DBEdit8DblClick(Se nder: TObject);
begin
WhichScreen := 'Delivery';
with DataModule3 do
begin
if not CusLookup.prepared
then
CusLookup.prepare;
CusLookup.ParamByName('Nam e').AsStri ng := 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('Nam e').AsStri ng := 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].AsInte ger;
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.DateTimePicker1Cha nge(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.ShowCheckb ox := 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.
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(Send
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(Sende
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('AD
end;
nbDelete : begin
Caption := 'Delete';
Glyph.LoadFromResource('DE
end;
nbPost :begin
Caption := 'Post';
Glyph.LoadFromResource('PO
end;
nbCancel :begin
Caption := 'Remove';
Glyph.LoadFromResource('RE
end;
end;
procedure TFrame1.DBEdit8DblClick(Se
begin
WhichScreen := 'Delivery';
with DataModule3 do
begin
if not CusLookup.prepared
then
CusLookup.prepare;
CusLookup.ParamByName('Nam
try
CusLookup.Open;
except
abort;
end;
form5.Show;
end;
end;
procedure TFrame1.DBEdit8Exit(Sender
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('Nam
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].AsInte
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.DateTimePicker1Cha
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:
begin
with DataModule3 do
begin
DateTimePicker1.ShowCheckb
DateTimePicker1.datetime := DestQuerydel_date.Value;
if DestQuerydel_time_am.Value
ListBox1.Selected[0] := true
else
ListBox1.selected[1] := true;
end;
end;
end.
ASKER
well what about LoadFromResource not being defined and the var c
ASKER
[Error] LogCall.pas(62): Type expected but 'BEGIN' found
[Error] LogCall.pas(73): Undeclared identifier: 'LoadFromResource'
[Error] LogCall.pas(73): Undeclared identifier: 'LoadFromResource'
C: Integer
Shane
Shane
Error] LogCall.pas(62): Type expected but 'BEGIN' found
is becasue there was no type for C
C: Integer;
Shane
is becasue there was no type for C
C: Integer;
Shane
ASKER
what about this
[Error] LogCall.pas(74): Undeclared identifier: 'LoadFromResource'
that has to be defined somehow no
how would i define it
[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
uses ......., Buttons;
SHane
I dont have a copy of the program - so i can't compile and test
Shane
Shane
ASKER
well check your e(mail) i will send the form
do you agree
do you agree
Did you add Buttons?
SHane
ASKER
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
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
Like this.....
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, DBCtrls, StdCtrls, Mask, DB, ComCtrls, Buttons;
Shane
ASKER
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
When you get an error that states "Undeclared identifier"
it means you are missing a Unit, which in this case, ,ight be BUTTONS!
Shane
ASKER
i added the buttons to the uses clause but it is still giving that message
[Error] LogCall.pas(74): Undeclared identifier: 'LoadFromResource'
[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
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
ASKER
[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'
that is also another message i am getting
[Fatal Error] Disp.dpr(20): Could not compile used unit 'LogCall.pas'
ASKER
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
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('AD D');
to these
Glyph.LoadFromResourceName (HInstance , 'ADD');
Shane
Glyph.LoadFromResource('AD
to these
Glyph.LoadFromResourceName
Shane
Forget sending it now, im getting ready to go to bed - its 11:00 PM here
Shane
Shane
ASKER
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"(tha t is the path of the resource file it is correct)
Glyph.LoadFromResourceName
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"(tha
ASKER
[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
[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"(tha t is the path of the resource file it is correct)
well, its either not there, or its damaged
Shane
[ 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"(tha
well, its either not there, or its damaged
Shane
ASKER
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:
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
remember image editor? I explained it was part of delphi, in the \bin directory, or on you rprograms menu
Shane
ASKER
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..
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
Restart and reload and recomile
Shane
ASKER
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
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
anyway, im going to bed - its late, and I got know where with you all night.....
Goodnight magma_george.
Shane
ASKER
i did restart everyhing and it is still doing the same
the same error messages
the same error messages
ASKER
well it complied just the stuff doesn't work it doesn't convert the old buttons into
the new images
thanks it compiles though
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
If it isn't here in 3 minutes im going to bed!
Shane
EMAIL IT NOW!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
mailed it to you
ASKER
did you get it
ASKER
i ain't getting anything form you
are you there
are you there
Shane
procedure TFrame1.FormActivate(Sende
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('AD
end;
nbDelete : begin
Caption := 'Delete';
Glyph.LoadFromResource('DE
end;
nbPost :begin
Caption := 'Post';
Glyph.LoadFromResource('PO
end;
nbCancel :begin
Caption := 'Remove';
Glyph.LoadFromResource('RE
end;
end;//case
end; //with TNavButton(Controls[c]) do
end;