Leaderboard
Popular Content
Showing content with the highest reputation on 10/21/23 in all areas
-
I need advice on converting a 500k lines 32bit Delphi 7 application to 64bit
aehimself replied to Yaron's topic in General Help
My advise would be to branch your master and do the conversion there. That way you can cherry pick bugfix commits between them but they would be separated enough. When conversion is done simply merge/cherry pick everything back to master. If you have no version control (which you definitely should) you can start to use IFDEFs to separate code. This will make it less readable and does not allow .dfm changes though. -
I need advice on converting a 500k lines 32bit Delphi 7 application to 64bit
Anders Melander replied to Yaron's topic in General Help
Don't do that; I don't know your code but I would think that very few strings actually need to be AnsiString. And even if your code already supports Unicode there can still be places that assume that SizeOf(Char)=SizeOf(Byte) and SizeOf(PChar^)=SizeOf(PByte^). Also, WideString is not the same as UnicodeString. WideString should generally only be used with COM. https://docwiki.embarcadero.com/RADStudio/Sydney/en/String_Types_(Delphi) -
Low-level experienced, I'm still learning. Android has a layer of complexity above Linux kernel. Socket API on Android is the same a socket API on Linux. Before entering to TWSocket port, you should begin with the simplest program which open a TCP client socket with pure API, and send any string and wait for the answer, display it on a TMemo and then close. A simple TForm with a TButton and a TMemo will be enough. Use one of the server samples in ICS for Windows to connect to. You can find simple C-code for Linux that you can start with. If you are able to port this C-code to Delphi/FMX for Android, then you are probably ready to start porting ICS. If you want to discuss further, please open a new topic with proper subject to catch attention of interested peoples. Maybe some will help.
-
Suggestion of naming convention for enumerators
PeterBelow replied to JohnLM's topic in Algorithms, Data Structures and Class Design
There is no point to all of this effort in my opinion, just use methods of the TEncoding "class" directly. If you insist on writing your own wrappers do not declare your own enumeration for the encodings, just let your methods take a parameter of type TEncoding, to which you can then pass TEncoding.UTF8 or one of the other predefined encodings TEncoding offers. -
I need advice on converting a 500k lines 32bit Delphi 7 application to 64bit
David Heffernan replied to Yaron's topic in General Help
My take on this is that you want to start making changes in your Delphi 7 code base that don't change the meaning of the program there, but mean that it will compile and work as expected in both ANSI and Unicode Delphi. In an ideal world you'd be able to do all that work preparing for the switch and reach a point where you can compile with both ANSI and Unicode Delphi, and the program works the same. Then you can cut the chord to Delphi 7 and commit to Unicode Delphi. Then you do the second piece of work which is to get the code working on 64 bit. -
I need advice on converting a 500k lines 32bit Delphi 7 application to 64bit
FPiette replied to Yaron's topic in General Help
I converted a lot of code, most without any issue. I you have done like me, that is using each data type for what it really is, there will be no issue. But if you used, for example, a string as a general buffer instead of an array of byte, then you'll have to change your code. Another example is of you use Windows messages (PostMessage and other API function in the same category), if you used LPARM and WPARAM, then no issue. If you used other data types as integer of unsigned, then you have to change your code. There are other similar cases. The biggest issue can come from 3rd party components which may not exists anymore and for which you don't have full source code. If you have full source code, you can recompile (with the same issues as you own code). If you don't have source code, even if the component still exists, you may be faced with their evolution over the years: properties, events, function may now differ. I can't be more precise with seeing your code... -
I need advice on converting a 500k lines 32bit Delphi 7 application to 64bit
Remy Lebeau replied to Yaron's topic in General Help
None of that has anything to do with migrating from 32-bit to 64-bit. Only with migrating from ANSI to Unicode. You can still use the ANSI types in 64-bit code if you need to, albeit more explicitly than before. -
I need advice on converting a 500k lines 32bit Delphi 7 application to 64bit
DelphiUdIT replied to Yaron's topic in General Help
I have no knowledge of any tool for automatic conversion (even partial). There are several contexts you should pay attention to when converting: 1) string: currently the definition is Unicode, in Delphi7 it was synonymous with AnsiString; 2) char: 1 character occupies two bytes. in Delphi7 it occupied 1 byte; 3) several definitions have changed in both core and third-party components; 4) several basic components distributed with Delphi7 are no longer distributed with Delphi 10.3, and obviously there must be third-party 64-bit components if you use them; 5) when converting between 32 and 64 bit you must pay attention to the various types of parameters, especially in third-party DLLs: PChar, PWChar, PAnsiChar.... 6) Integer, cardinal, nativeint, etc.... 7) Floating Extended type is 80 bit long in 32 bit application, but in 64 bit is an alias of double (64 bit long); 8 Pointers in 32 bit platforms are 4 bytes length, in 64 bit platforms they are 8 bytes length. 9) In 64 bit platforms you cannot mix assembler and pascal in the same method. 10) more other stuff Look here for more info: https://docwiki.embarcadero.com/RADStudio/Rio/en/Converting_32-bit_Delphi_Applications_to_64-bit_Windows Good luck and good work -
I need advice on converting a 500k lines 32bit Delphi 7 application to 64bit
Uwe Raabe replied to Yaron's topic in General Help
It depends on the actual sources. I have had projects that just needed a compile with the new version and target, while others lasted several months. -
How to make FMX form fully transparent but not lose focus when clicked?
E. Spelt replied to XylemFlow's topic in FMX
Maybe you can use a TLayout with property HitTest to true? It should catch the mouse events and does not have any background. -
Sample test application for SQL framework. https://delphihtmlcomponents.com/sqltest.rar What it can do? Extract and transform data directly from Excel, CSV, JSON and XML files and archives. How to use: choose file or folder and write SQL query. Example: select all data from Excel sheet (sample.xlsx is included): select * from sample.sheet1 List of countries (we should exclude first row with caption using _row pseudo field). select distinct b from sample.sheet1 where _row > 0 Calculate sum of sales by country select B country, sum(H) sales from sample.sheet1 where _row > 0 group by 1 Countries (B) present in both segments (A) select B from sample.sheet1 where A = 'Government' intersect select B from sample.sheet1 where A = 'Midmarket' JSON file (customers.json is included): select * from customers where email like '%.ca' Using joins (sales_data.zip is included, it contains four JSON files: sales, orders, customers and products): select c.name, o.orderId, o.date, p.name, s.quantity from sales_data.sales s join sales_data.orders o on o.orderid=s.orderid join sales_data.customers c on c.customerid=o.customerid join sales_data.products p on p.productid=s.productid Calc percent from max quantity select c.name, o.orderId, o.date, p.name, round(100 * s.quantity / (select max(cast(quantity as float)) from sales_data.sales)) qpercent from sales_data.sales s join sales_data.orders o on o.orderid=s.orderid join sales_data.customers c on c.customerid=o.customerid join sales_data.products p on p.productid=s.productid List of products by order select o.orderId, o.date, list(p.name, ', ') products from sales_data.sales s join sales_data.orders o on o.orderid=s.orderid join sales_data.products p on p.productid=s.productid group by 1, 2 XML (cust.xml example included). Sometimes XML files has comples structure and contain different objects. To select only necessary objects we use XPATH. Also XPATH can be used in field names: select CustomerID, "/CompanyName" Company, "/FullAddress/City" City from cust('/Customers/Customer') Join with orders in the same file: select c.CustomerID, c."/CompanyName" Company, c."/FullAddress/City" City, cast(o."/OrderDate" as Date) OrderDate from cust('/Customers/Customer') c join cust('/Orders/Order') o on o."/CustomerID" = c.CustomerID CSV (survey.csv is included) Same naming scheme as for Excel. Excample: top 10 industries by income select C industry, sum(H) income from survey where F = 'Total income' group by 1 order by 2 desc rows 1 to 10 What is supported: select from select join, left join union, union all, intersect distinct, order by, group by, rollup, having first skip last rows limit fetch nulls last sum, max, min, avg, list/listagg = <> > >= < <= + - * / mod || in between like not like starting with and or exists, any, some, all subselects cast, decode, iif, case, coalesce Almost all Firebird funcions https://firebirdsql.org/refdocs/langrefupd21-intfunc.html, Oracle and MSSQL functions.
-
Hiding a public property in a descendant class
Cristian Peța posted a topic in RTL and Delphi Object Pascal
TMyEdit = class(TCustomEdit) private property Text; end; I try to hide the Text property of TCustomEdit in a descendant class but it doesn't work. Code insight (LSP) in other unit does not see it but the compiler does not complain if I use it. Can I do something to hide the Text property? -
Hiding a public property in a descendant class
Fr0sT.Brutal replied to Cristian Peța's topic in RTL and Delphi Object Pascal
(YourEdit as TCustomEdit).Text := 'ahaha' -
Hiding a public property in a descendant class
Bill Meyer replied to Cristian Peța's topic in RTL and Delphi Object Pascal
Visibility can be increased, but not decreased. I seem to recall someone using a trick to gain the effect, but can't recall when or where. This is one of the drawbacks of inheritance. You may find this discussion helpful: https://stackoverflow.com/questions/4749867/delphi-how-to-hide-ancestor-methods