Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 01/15/25 in all areas

  1. I don't know how much your time is worth but for an advanced grid component buying off-the-shelf is a no-brainer. And option 2 doesn't sound any less work than moving to a new component. We use TMS VCL UI Pack which includes their TAdvStringGrid component, the price is practically nothing compared to what you get in terms of functionality.
  2. Der schöne Günther

    Pointer arithmetic question

    Oh sorry, was this a C++ question? In that case, let's add p_int = &2[arr]; std::cout << "p_int points to " << *p_int << std::endl; // 102 to the list, just for fun.
  3. Remy Lebeau

    Pointer arithmetic question

    In C++, that example would look like this: #include <iostream> int main() { int value = 42; int *p_int = &value; std::cout << "p_int points to " << *p_int << std::endl; // 42 int arr[] = {100, 101, 102}; p_int = &arr[1]; std::cout << "p_int points to " << *p_int << std::endl; // 101 ++p_int; std::cout << "p_int points to " << *p_int << std::endl; // 102 ++p_int; std::cout << "p_int points to " << *p_int << std::endl; // (OUT OF BOUNDS - UNDEFINED BEHAVIOR!) }
  4. Roger Cigol

    Pointer arithmetic question

    Whilst agreeing totally with @Lars FosdalI am puzzled by your reaction. It is clear that every posting you received was aimed at helping / educating you. I can't see any sign of anyone being patronising. I like to think that all the many experienced developers that look at Delphi-Praxis are understanding of less experienced folk who are trying to learn. Please continue to ask questions. Be patient if you don't always get a simple answer and check that you have expressed your question in as clear as way as you can.
  5. Anders Melander

    Continually Losing Frames

    So you're not using version control?
  6. From today, TMS Academic products are available for Delphi & C++Builder 12 Community Edition, and they're 100% free and fully functional for students and teachers working on non-commercial projects. If you're passionate about programming and want to excel in your education, join the TMS Academic program and start building amazing software with powerful tools like TMS FNC UI Pack, TMS Aurelius, TMS WEB Core, and more. Read the full blog post: https://www.tmssoftware.com/site/blog.asp?post=1306
  7. emileverh

    Retrieve value of INSERT ... RETURNING ...?

    If I was you in SQLite I defined 'database_id' as AUTOINCREMENT. No duplicates anymore! CREATE TABLE databases ( database_id INTEGER PRIMARY KEY AUTOINCREMENT And if you want to know the last inserted id, call the following statement: select LAST_INSERT_ID() as seq
  8. Der schöne Günther

    Pointer arithmetic question

    Make sure the type of your pointer is correct when doing stunts like pointer arithmetic. For example, PInteger when dealing with Integer. Short example: program Project1; var int: Integer; ints: TArray<Integer>; p_int: PInteger; begin int := 42; p_int := Addr(int); WriteLn('p_int points to ', p_int^); // 42 ints := [100, 101, 102]; p_int := Addr(ints[1]); WriteLn('p_int points to ', p_int^); // 101 Inc(p_int); WriteLn('p_int points to ', p_int^); // 102 Inc(p_int); WriteLn('p_int points to ', p_int^); // (some random number) end.
  9. Angus Robertson

    Errors in OverbyteIcsHttpProt

    Thanks, for the explanation, I see that buffer is a dynamic TBytes, unusual for 20 years ago when Delphi didn't really support TBytes. I only started making wide use of TBytes a few years ago with a lot of new library functions. I'll fix the code, and check other receive loops for similar problems. I'm hoping to release ICS V9.4 this month, with various minor fixes. Angus
  10. Anders Melander

    Pointer arithmetic question

    I don't know where you are reading this but the sentence is assuming that the pointer points to an element in an array of integers. So incrementing the pointer will make it point to the next integer in the array. Maybe you should stay away from pointers until you figure this out 🙂
  11. Anders Melander

    Old ProfGrid component: modernize or migrate away?

    I would go with option 1; Get rid of the technical debt once and for all. Even if you managed to get ProfGrid working now (which is probably possible, given enough effort) you would then have to maintain it yourself going forward and since you don't have Pascal expertise this doesn't sound sustainable.
  12. I can of course not say I made this as the channel header tell. My contribution is very minor. But I want to share this story anyway. And hopefully someone can use or even contribute to Bold framework. Yesterday I committed a bunch of updates to Bold for Delphi https://github.com/Embarcadero/BoldForDelphi/tree/develop History of Bold for Delphi Bold for Delphi is a Model-Driven Architecture (MDA) framework developed in the late 1990s by BoldSoft, a Swedish company. Jan Norden was one of thefounders. Bolds main focus was to enable developers to create business applications by defining the application's data structure and business rules at a higher abstraction level, rather than writing low-level code manually. In 2002, Borland acquired BoldSoft, and Bold for Delphi was included in Borland’s release of Delphi 7 Architect. This made the framework more accessible to Delphi developers and encouraged its adoption within the Delphi ecosystem. However, after Borland sold its development tools division to CodeGear. Later Embarcadero took over. Now Bold for Delphi was no longer actively developed as part of the Delphi IDE. Bold for Delphi was used in many hundreds of projects with Delphi 7. Developers was now abandoned with no support from Code/Gear/Embarcadero. But development never stopped completely. Before Borland bought Boldsoft Ahola Transport, a Finnish company bought source-code license from Boldsoft. They developed an in-house ERP application Attracs for transport business now with full access to Bolds source. Around 2010 Attracs company hired a consultant Daniel Mauric from Serbia mainly because hes deep knowledge about Bold. This turned out to be a very good move. Now the development of Bold for Delphi really gained momentum. Daniel has made countless optimizations, bug fixes but also some completely new additions to Bold. But one problem was that Bolds Intellectual Property (IP) was still hold by Embarcadero. We couldn't legally publish our changes even if we want to cooperate with other developers around the source. In May 2012 I Roland Bengtsson made a petition to release Bold with opensource license. And the petition got attention. After a while when I contacted Embarcadero we agreed on a meeting and it looks promising. But later Embarcadero changed their mind and set up unreasonable conditions like all changes with source remain Embarcaderos IP. And the years passed... Delphi product manager at Embarcadero changed to Marco Cantu. When I discussed this issue with him I noticed quickly he had a more realistic view on this. Marco realized that the only way forward was to make Bold opensource. I have no idea what happened behind the scenes but Marco convinced Embarcaderos management and published this blog 22 Sep 2020 So a big thank you to @Marco Cantu for his work! Our company now renamed to Ahola Digital continue to work with our main Bold application Attracs. Our Bold source continue to improves thanks to Daniel Mauric. These changes are now published in repository above. There is a lot more to do. Many inhouse tools and source are not commited in to repository yet. Main Purpose of Bold for Delphi The primary purpose of Bold for Delphi is to simplify the development of business applications by automating data persistence, object lifecycle management, and business rule enforcement. It emphasizes separation of concerns by letting developers focus on defining the model (business logic and rules) while the framework handles boilerplate tasks such as: Object-relational mapping (ORM) Automatic data synchronization with a database Real-time data updating in the user interface Implementation of business logic constraints and rules It essentially follows the MDA approach, where application logic is derived from the model, reducing repetitive code writing and increasing consistency across applications. Main Components of Bold for Delphi Bold Model and UML Integration: Developers define the application’s data model using UML diagrams. Rational Rose is supported but unfortunately IBM have The model is then translated into Delphi classes with associated behavior and persistence rules. Bold Business Classes: These are Delphi classes generated from the UML model. They represent the business objects, containing properties, associations, and behavior logic. Bold Object Layer: Handles the lifecycle of objects, including creation, deletion, and memory management. Ensures real-time synchronization between the application and the database. Bold Persistence Layer: Manages object persistence by mapping the Bold business classes to database tables. Abstracts database interactions, so developers don't need to write SQL manually. Bold Expression Language (OCL): A query and constraint language similar to SQL but designed for object models. Used to express rules, queries, and computed attributes in the model. Bold User Interface Components: Data-aware UI components, such as grids and editors, are bound directly to the Bold object model. Provides real-time updates as the model changes. Bold Subscription System: Ensures the UI and other dependent components react automatically when model data changes. Key Advantages of Bold for Delphi Rapid Development: Reduces repetitive coding by generating classes and managing persistence automatically. Model-Driven Approach: Ensures the application's logic and design are consistent and well-structured. Scalability: Supports complex object relationships and business rules with minimal effort. Real-Time Updates: Automatically synchronizes UI and data layers for responsive applications. Example Use Cases Bold for Delphi is particularly suited for: Enterprise resource planning (ERP) systems Customer relationship management (CRM) systems Applications with complex domain models and business rules It remains a valuable tool for Delphi developers who need to build sophisticated, model-driven applications efficiently. If you are interested to contribute or just have a question about Bold do not hesitate to ask me. I would do my best to help!
  13. bravesofts

    Bold for Delphi history and update

    Would you consider adding some video tutorials on how to use Bold? It would be very helpful if the demo databases were PostgreSQL, SQLite, or even Paradox, as this would make it easier to understand the entire concept at once.
  14. Done RSS-2712: Android Fix Stretched Splash Images
  15. Keep it simple - create a class helper for TMemo and add an Assign method and just set the props you need. This will be quicker and easier than messing with RTTI (which can be a bit of a rabbit hole with some property types).
  16. Temporary Solution: By using Delphi's TValue type from the System.Rtti unit, I was able to implement a robust custom Writeln procedure usin overload. Here's how it works: Main Procedure to Process Arguments This procedure processes the arguments, determining their types and formatting them as needed: procedure DoCustomWriteln(const Args: array of TValue); var LArg: TValue; LOutput: string; I: Integer; begin LOutput := ''; for I := Low(Args) to High(Args) do begin LArg := Args[I]; case LArg.Kind of tkInteger: LOutput := LOutput + IntToStr(LArg.AsInteger); tkFloat: LOutput := LOutput + FloatToStr(LArg.AsExtended); tkString, tkLString, tkUString, tkWString: LOutput := LOutput + LArg.AsString; tkChar, tkWChar: LOutput := LOutput + LArg.AsString; tkVariant: try LOutput := LOutput + VarToStr(LArg.AsVariant); except LOutput := LOutput + '<invalid variant>'; end; else LOutput := LOutput + '<unsupported type>'; end; // Add a separator unless it's the last argument if I < High(Args) then LOutput := LOutput + ', '; end; Writeln(LOutput); end; Overloading Writeln To make calling this function straightforward without requiring brackets, I created multiple overloads for the CustomWriteln procedure: procedure CustomWriteln(A1: TValue); overload; begin DoCustomWriteln([A1]); end; procedure CustomWriteln(A1, A2: TValue); overload; begin DoCustomWriteln([A1, A2]); end; procedure CustomWriteln(A1, A2, A3: TValue); overload; begin DoCustomWriteln([A1, A2, A3]); end; // Add more overloads as needed for additional parameters Test in Project: begin try // Examples of usage with different types CustomWriteln(42); CustomWriteln(3.14, 'Hello'); CustomWriteln(1, 2.2, 'Text', True); CustomWriteln(1, 'Two', 3.3, 'Four', False, 6); except on E: Exception do Writeln(E.ClassName, ': ', E.Message); end; Readln; end. Example Output ------- 42 3,14, Hello 1, 2,2, Text, <unsupported type> 1, Two, 3,3, Four, <unsupported type>, 6 Advantages of This Approach: Flexible Input: Handles integers, floats, strings, characters, and variants. Type-Safe: Uses TValue to handle types dynamically. Scalable: Easy to extend by adding more overloads or enhancing DoCustomWriteln. --- Final Project: program CustomWritelnProj; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils, System.Variants, System.Math, System.Rtti; procedure DoCustomWriteln(const Args: array of TValue); var LArg: TValue; LOutput: string; I: Integer; begin LOutput := ''; for I := Low(Args) to High(Args) do begin LArg := Args[I]; case LArg.Kind of tkInteger, tkInt64: LOutput := LOutput + LArg.AsInt64.ToString; tkFloat: LOutput := LOutput + LArg.AsExtended.ToString; tkEnumeration: LOutput := LOutput + BoolToStr(LArg.AsBoolean, True); tkString, tkLString, tkUString, tkWString, tkChar, tkWChar: LOutput := LOutput + LArg.AsString; tkVariant: try LOutput := LOutput + LArg.AsVariant.ToString; except LOutput := LOutput + '<invalid variant>'; end; else LOutput := LOutput + '<unsupported type>'; end; // Add a separator unless processing the last element if I < High(Args) then LOutput := LOutput + ', '; end; Writeln(LOutput); end; // Overloaded CustomWriteln implementations procedure CustomWriteln(A1: TValue); overload; begin DoCustomWriteln([A1]); end; procedure CustomWriteln(A1, A2: TValue); overload; begin DoCustomWriteln([A1, A2]); end; procedure CustomWriteln(A1, A2, A3: TValue); overload; begin DoCustomWriteln([A1, A2, A3]); end; procedure CustomWriteln(A1, A2, A3, A4: TValue); overload; begin DoCustomWriteln([A1, A2, A3, A4]); end; procedure CustomWriteln(A1, A2, A3, A4, A5: TValue); overload; begin DoCustomWriteln([A1, A2, A3, A4, A5]); end; procedure CustomWriteln(A1, A2, A3, A4, A5, A6: TValue); overload; begin DoCustomWriteln([A1, A2, A3, A4, A5, A6]); end; procedure CustomWriteln(A1, A2, A3, A4, A5, A6, A7: TValue); overload; begin DoCustomWriteln([A1, A2, A3, A4, A5, A6, A7]); end; procedure CustomWriteln(A1, A2, A3, A4, A5, A6, A7, A8: TValue); overload; begin DoCustomWriteln([A1, A2, A3, A4, A5, A6, A7, A8]); end; procedure CustomWriteln(A1, A2, A3, A4, A5, A6, A7, A8, A9: TValue); overload; begin DoCustomWriteln([A1, A2, A3, A4, A5, A6, A7, A8, A9]); end; begin try // Examples of usage with different types CustomWriteln(42); CustomWriteln(MaxComp,'The max value of Int64'); CustomWriteln(MaxComp,MinComp, 'Int64 Interval'); CustomWriteln(1, 2.2, 'Text', True); CustomWriteln(1, 'Two', 3.3, 'Four', False, 6); except on E: Exception do Writeln(E.ClassName, ': ', E.Message); end; Readln; end.
  17. Hi I thought it make sense to share the link to our discussion on that topic in the TestComplete forum. https://community.smartbear.com/discussions/testcomplete-questions/delphi-12-x-officially-unsupported/267672 Well, I know that a lot is not properly running (e.g. VCL Styles). But until now, we were still able to run our large number of test cases. But after dropping AQTime, now SmartBear silently drops the Delphi support for TestComplete as well. TBO, the new SmartBear subscription model is far too expensive compare with our last 3 year renewals. And we do normally not use any software on "rental base" that stops suddenly. But transferring all the tests to something "new" is a nightmare ... somehow a deadlock again. regards Günther
  18. shineworld

    What is the best AI at Delphi

    You can "teach" chatgpt with tags to avoid to repeat same things, eg: to chatgpt > When I use tag #DCODE you have to create a clean Delphi code as in followed text description adding short comments which does not use capital letter, eg: // sort the list, etc etc etc. So you can ask: > #DCODE create an alphabetical acending and descending sort of a TList<string> object.
  19. stijnsanders

    RAD Studio Breakpoints not working

    I still find it a valid question. I remember this time I had something similar and fixed it by deleting the project's dcu's, to have compile/build generate all new ones. I don't remember how many Delphi versions ago it was though...
  20. azrael_11

    Shellexecute cmd.exe with spaces

    That work just fine. Thank you.
×