Gary
-
Content Count
128 -
Joined
-
Last visited
Posts posted by Gary
-
-
Anyone know how to get rid of this?
-
Not sure what you mean by "change caption for different fields".
You can do this at design time by right click fdTable and open field editor, right click and add all fields (or the ones you want), then set the DisplayLabel property of each field.
Hope that helps
-
I do something similar to Danny. DBControls and TDataSource on form, Devart components on a TDataModule. I have a unit between them, but to avoid having your form reference the DataModule you can assign them at runtime TForm.TDataSource.DataSet := TDataModule.TMyQuery.
Also it seems that your customer knows his way around a database. You might have a look at http://www.rosinsky.cz/delphi/
Thomas has a filter dialog, as well as a Grid properties dialog that allows the end user to select the grid columns and create filters almost as good as a SQL statement
Gary
-
Ya, so is it bad practice to have a simple class like
TReminderItem = class
public
EmployeeID: Integer;
EmployeeName: String;
HireDate: TDate;
LastDate: TDate;
Notes: String;
end;without the requisite properties, getters and setters just to move data around?
-
Thanks Stefan,
I have always been confused by records and pointers, but with the new custom managed records wanted to give it another try since it looks like records for just data storage are simpler to work with than classes. I will probably just use a class with simple properties but here is the revised code with record pointer. I do need to change Data as I will use the record to read data from a database and fill the list with records.
TReminderItem = record
FEmployeeID: Integer;
FEmployeeName: String;
FHireDate: TDate;
FLastDate: TDate;
FNotes: String;
end;PReminderItem = ^TreminderItem;
procedure TForm1.Button1Click(Sender: TObject);
var
LList : TList<PReminderItem>;
LReminderItem : PReminderItem;
begin
LList := TList<PReminderItem>.Create;
try
GetReminder(LList);
ShowMessage(Format('Name: %s', [LList[0]^.FEmployeeName]));
finally
for LReminderItem in LList do
Dispose(LReminderItem);
LList.Free;
end;
end;procedure TForm1.GetReminder(AList: TList<PReminderItem>);
var
LReminderItem : PReminderItem;
begin
// LReminderItem := TReminderItem.Create;
New(LReminderItem);LReminderItem^.FEmployeeID := 1;
LReminderItem^.FEmployeeName := 'Test Name';
LReminderItem^.FHireDate := Now;
LReminderItem^.FLastDate := Now;
LReminderItem^.FNotes := 'A Note';AList.Add(LReminderItem);
end;
Thanks again
Gary
-
So how do I do it? I have tried Dispose,
finally
for LReminderItem in LList do
Dispose(LReminderItem);
LList.Free;
end;I get a compiler error incompatible type
if I try (No doubt wrong) using the correct type
var
PReminderItem : ^TReminderItem;
and
finally
for LReminderItem in LList do
begin
PReminderItem := @LReminderItem;
Dispose(PReminderItem);
end;
LList.Free;
end;It compiles but I get an exception
Also David notice the list is indeed a TList<TReminderItem>.
if I just leave out the attempt to free the memory and just free the List I get the Memory leak
-
Delphi 10.4.1
Windows 10
Why does this leak memory? FastMM4 reports
A memory block has been leaked. The size is: 36
This block was allocated by thread 0x948, and the stack trace (return addresses) at the time was:
4070A2 [System.pas][System][@GetMem$qqri][4843]
40A0F7 [System.pas][System][@NewUnicodeString$qqri][25659]
40A584 [System.pas][System][@UStrAsg$qqrr20System.UnicodeStringx20System.UnicodeString][26643]
615C6A [Unit1.pas][Unit1][TForm1.GetReminder][65]
616166 [Unit1][Generics.Collections.%TList__1$19Unit1.TReminderItem%.Create]
615A34 [Unit1.pas][Unit1][TForm1.Button1Click][46]
770168CF [GetWindowLongW]
720A55DC [Unknown function at SetWindowSubclass]
4086D3 [System.pas][System][@IsClass$qqrxp14System.TObjectp17System.TMetaClass][18453]
553531 [Vcl.Controls.pas][Vcl.Controls][Controls.TControl.Click][7596]
56C28B [Vcl.StdCtrls.pas][Vcl.StdCtrls][Stdctrls.TCustomButton.Click][5609]type
TReminderItem = record
public
RecordID: Integer;
EmployeeID: Integer;
EmployeeName: String;
HireDate: TDate;
LastDate: TDate;
Notes: String;
procedure Clear;
end;TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
procedure GetReminder(AList: TList<TReminderItem>);
end;var
Form1: TForm1;implementation
{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
var
LList : TList<TReminderItem>;
LReminderItem : TReminderItem;
PReminderItem : ^TReminderItem;
begin
LList := TList<TReminderItem>.Create;
try
GetReminder(LList);
ShowMessage(LList[0].EmployeeName);
finally
for LReminderItem in LList do
LReminderItem.Clear;
LList.Free;
end;
end;procedure TForm1.GetReminder(AList :TList<TReminderItem>);
var
LReminderItem: ^TReminderItem;
begin
New(LReminderItem);
LReminderItem.RecordID := 1;
LReminderItem.EmployeeID := 1;
LReminderItem.EmployeeName := 'Test';
LReminderItem.HireDate := Now;
LReminderItem.LastDate := Now;;
LReminderItem.Notes := 'A Note';AList.Add(LReminderItem^);
end;{ TReminderItem }
procedure TReminderItem.Clear;
begin
Self := Default(TReminderItem);
end;
This is just my latest attempt, I have tried Finalize, FinalizeRecord, FreeMem. The Clear procedure is also an attempt after seeing it in a different post.What is the proper way to free memory of a record I create in a list?
Thanks in advance,
Gary
-
For me as well!
Thanks Uwe
-
I have the same problem Access Violation ntdll.dll
Also worked fine in 10.4.1
Still works just gives violation on startup
From their blog
Pascal Analyzer, Pascal Browser and Pascal Expert support Delphi 10.4!
August 7, 2020
-
Do you have tblConts linked in any way to other tables? Master/Detail?
-
Bought the eBook recently. On chapter 8. I found several tips and explanations already that made it more than worth the price.
- 1
-
Maybe a long shot...I have this happen from time to time and the problem is TestInsight, for no reason the 'run tests continually when idle' gets selected. IDE will seem to hang because tests are running. Drove me crazy until I found it.
-
I use http://www.rosinsky.cz/delphi/ his DB controls including grid are $70 whole package that includes some excellent dialogs for end user is $95. He is very responsive to support.
-
The problem is not with MMX but AQTime. Once I finished test driving AQTime and started work I found that it hijacked the right click. I no longer had the Delphi popup.
Removed both, Re-Installed AQTime - no Delphi popup just AQTime.
Removed AQTime Re-Install MMX - All is good in code land again!!
-
Awesome just to get a response!! And on a Sunday playoff weekend
-
I just found AQTime Standard on GetIt and installed it. Found an old post on how to use it.
Dr.Bob Examines... #131: Delphi XE and AQtime Standard (drbob42.com)
After creating a project the first step is to right click the left pane to add modules.
Doing this brings up MMX Commands > , now it's displayed over everything. I just went back and tried in Delphi and when I switch back to finish this post the MMX Command popup is still on screen.
From here on out it's a fight between MMX and every other menu. You can click a second time or third to eventually get what you want. This includes Delphi menu's.
-
@emailx45
Success!!
The fact that both of our licenses are the same for IBLite is no surprise, especially if you look at the docwiki I linked above. It is part of the install for all Rad Studio editions.
FYI you should know that the links you sent above for XE3 do not apply for Rio? and above, in fact if you run the license registration and use the .txt file it will not work.
As to licenseManager, I checked again and that screenshot was from the Interbase\bin directory.
I had to start over and use your example as a guide. Thanks much. I still am not sure where I went wrong. I think some of it had to do with setting things in the IDE,
and also I was using TIBDatabase instead of Firedac.
I did not reply back right away, I wanted to see if I could find the problem. The project I redid works perfectly... in 32 .. but still get error cannot find library in 64. Even the test project you uploaded, I copied the redist and license file and same result.
I am more than happy to settle for the working 32 bit version. For the most part I program as a hobby and the single user desktop programs I build are for friends and family at, no charge (maybe dinner). So an upgrade from Advantage Database that support stopped in 2015 to Interbase puts a smile on my face.
Thanks again
Gary
-
From License.txt included
So does this mean that with the included reg_iblite.txt file this is a deployable edition??
25.9 INTERBASE LITE EDITION
Under the InterBase Lite Edition license (“Lite Edition”) included with RAD Studio, Licensee may install the Lite Edition software on any number of mobile and Desktop devices from a single instance of an application built with RAD Studio and running on the same device on which the instance of Lite Edition is executing for use by one concurrent user at any one time. The number of users installing or using the Lite Edition shall be measured as the number of distinct inputs to the multiplexing or connection pooling front end. Licensee may not use multiplexing or connection pooling software or hardware to reduce the number of users directly connected to the Lite Edition software. Licensee's user may not connect to the Lite Edition software via an unrestricted-access Internet application. -
@emailx45
I really appreciate the help!
It does seem to be a license problem that I don't understand.
See here: http://docwiki.embarcadero.com/RADStudio/Sydney/en/IBLite_and_IBToGo_Deployment_Licensing
especially this:
IBLite License
All RAD Studio 10.3 Rio editions include a free IBLite license for all platforms as part of the installation.Note: No additional installation or license activation procedures are required.
I have a .txt file that works. To make sure I ran the : https://reg.codegear.com/srs6/activation with my Delphi serial# and tried the .txt file from that. I got an error saying not licensed. I don't get that error with the included reg_iblite.txt.
-
True. So with a valid license my problem is the "ibtogo64.dll not found in the path" error. Any ideas?
-
I posted that as well
-
@emailx45
From Embarcadero:
RAD Studio includes InterBase 2020 ToGo and IBLite editions for embedded application development.
Developers can deploy their multi-device applications on Windows (32-bit and 64-bit), macOS (32-bit and 64-bit), iOS (32-bit and 64-bit) or Android (32-bit and 64-bit) devices with an IBLite license, for free. Also, developers using RAD Studio 10.3 Rio Enterprise or Architect editions can deploy their iOS and Android applications with the InterBase ToGo (IBToGo) for Mobile license included.
The license I have for Interbase IBLite is a result of the $ I shelled out for my Pro edition. Users that paid for Enterprise or Architect have the same ability with ToGo, so this is the intended use for the license not using a development edition for deployment.
-
@emailx45
I think it is meant to be a "tease" version. Advantage worked that way for years. It was limited but allowed customers to test drive apps with real data, and even use for a while. Then seamlessly upgrade to client server.
-
Yes, but iblite is suppose to be free
How to run Interbase developer in 10.4 and 11
in Databases
Posted
Hello all,
I just installed Delphi 11 along with the developer edition of Interbase. All worked fine until I tried connecting from Delphi 10.4.
After trial and error I found that both installations create a developer_ib2020 instance. However each version uses it's own location path and the other cannot connect to this instance. C:\Program Files (x86)\Embarcadero\Studio\21.0\InterBase2020 for 10.4 and C:\Program Files (x86)\Embarcadero\Studio\22.0\InterBase2020 for Delphi 11.
So after installing Delphi 11 the Interbase Server Manager root directory is C:\Program Files (x86)\Embarcadero\Studio\22.0\InterBase2020, and connections from Delphi 11 work fine, but not from Delphi 10.4
If I load Delphi 10.4 and reinstall Interbase the Server Manager root directory is C:\Program Files (x86)\Embarcadero\Studio\21.0\InterBase2020, and now connections work from Delphi 10.4 but not Delphi 11.
How do I go about installing Interbase Developer so that I can connect from either version?
I did find an article that Error: Unavailable Database (embarcadero.com) and Changing InterBase connection defaults in RAD Studio (embarcadero.com) but no Joy.