Jump to content

Lars Fosdal

Administrators
  • Content Count

    3335
  • Joined

  • Last visited

  • Days Won

    110

Posts posted by Lars Fosdal


  1. We use FastReports for simple reports, and it has been somewhat challenging due to quirky behaviours such as not liking to be used in parallell threads. 

    Since we didn't need client tools for report design, but only crafted the reports in the development phase, it was chosen due to being available out of the box.

     

    We also use a server version of Crystal Reports that is fed through database queue tables and driven by a standalone integration to produce labelling and documents.


  2. Delphi 11.3 28.0.47991.2819  (Update 3 + Patch 1)

     

    Quote

    {$A8,B-,C+,D+,E-,F-,G+,H+,I+,J-,K-,L+,M-,N-,O+,P+,Q-,R-,S-,T-,U-,V+,W-,X+,Y+,Z1}
    {$MINSTACKSIZE $00004000}
    {$MAXSTACKSIZE $00100000}
    {$IMAGEBASE $00400000}
    {$APPTYPE CONSOLE}
    {$WARN SYMBOL_DEPRECATED ON}
    {$WARN SYMBOL_LIBRARY ON}
    {$WARN SYMBOL_PLATFORM ON}
    {$WARN SYMBOL_EXPERIMENTAL ON}
    {$WARN UNIT_LIBRARY ON}
    {$WARN UNIT_PLATFORM ON}
    {$WARN UNIT_DEPRECATED ON}
    {$WARN UNIT_EXPERIMENTAL ON}
    {$WARN HRESULT_COMPAT ON}
    {$WARN HIDING_MEMBER ON}
    {$WARN HIDDEN_VIRTUAL ON}
    {$WARN GARBAGE ON}
    {$WARN BOUNDS_ERROR ON}
    {$WARN ZERO_NIL_COMPAT ON}
    {$WARN STRING_CONST_TRUNCED ON}
    {$WARN FOR_LOOP_VAR_VARPAR ON}
    {$WARN TYPED_CONST_VARPAR ON}
    {$WARN ASG_TO_TYPED_CONST ON}
    {$WARN CASE_LABEL_RANGE ON}
    {$WARN FOR_VARIABLE ON}
    {$WARN CONSTRUCTING_ABSTRACT ON}
    {$WARN COMPARISON_FALSE ON}
    {$WARN COMPARISON_TRUE ON}
    {$WARN COMPARING_SIGNED_UNSIGNED ON}
    {$WARN COMBINING_SIGNED_UNSIGNED ON}
    {$WARN UNSUPPORTED_CONSTRUCT ON}
    {$WARN FILE_OPEN ON}
    {$WARN FILE_OPEN_UNITSRC ON}
    {$WARN BAD_GLOBAL_SYMBOL ON}
    {$WARN DUPLICATE_CTOR_DTOR ON}
    {$WARN INVALID_DIRECTIVE ON}
    {$WARN PACKAGE_NO_LINK ON}
    {$WARN PACKAGED_THREADVAR ON}
    {$WARN IMPLICIT_IMPORT ON}
    {$WARN HPPEMIT_IGNORED ON}
    {$WARN NO_RETVAL ON}
    {$WARN USE_BEFORE_DEF ON}
    {$WARN FOR_LOOP_VAR_UNDEF ON}
    {$WARN UNIT_NAME_MISMATCH ON}
    {$WARN NO_CFG_FILE_FOUND ON}
    {$WARN IMPLICIT_VARIANTS ON}
    {$WARN UNICODE_TO_LOCALE ON}
    {$WARN LOCALE_TO_UNICODE ON}
    {$WARN IMAGEBASE_MULTIPLE ON}
    {$WARN SUSPICIOUS_TYPECAST ON}
    {$WARN PRIVATE_PROPACCESSOR ON}
    {$WARN UNSAFE_TYPE OFF}
    {$WARN UNSAFE_CODE OFF}
    {$WARN UNSAFE_CAST OFF}
    {$WARN OPTION_TRUNCATED ON}
    {$WARN WIDECHAR_REDUCED ON}
    {$WARN DUPLICATES_IGNORED ON}
    {$WARN UNIT_INIT_SEQ ON}
    {$WARN LOCAL_PINVOKE ON}
    {$WARN MESSAGE_DIRECTIVE ON}
    {$WARN TYPEINFO_IMPLICITLY_ADDED ON}
    {$WARN RLINK_WARNING ON}
    {$WARN IMPLICIT_STRING_CAST ON}
    {$WARN IMPLICIT_STRING_CAST_LOSS ON}
    {$WARN EXPLICIT_STRING_CAST OFF}
    {$WARN EXPLICIT_STRING_CAST_LOSS OFF}
    {$WARN CVT_WCHAR_TO_ACHAR ON}
    {$WARN CVT_NARROWING_STRING_LOST ON}
    {$WARN CVT_ACHAR_TO_WCHAR ON}
    {$WARN CVT_WIDENING_STRING_LOST ON}
    {$WARN NON_PORTABLE_TYPECAST ON}
    {$WARN XML_WHITESPACE_NOT_ALLOWED ON}
    {$WARN XML_UNKNOWN_ENTITY ON}
    {$WARN XML_INVALID_NAME_START ON}
    {$WARN XML_INVALID_NAME ON}
    {$WARN XML_EXPECTED_CHARACTER ON}
    {$WARN XML_CREF_NO_RESOLVE ON}
    {$WARN XML_NO_PARM ON}
    {$WARN XML_NO_MATCHING_PARM ON}
    {$WARN IMMUTABLE_STRINGS OFF}
     

     

    Off-topic:

    Ctrl+O + Ctrl+O behaves weirdly, IMO. 

    It inserts at top of file instead of at cursor, and it doesn't respect existing options like {$APPTYPE CONSOLE}


  3. We used OutputDebugString for a while, but found that if you had a large number of logged outputs from multiple threads, it would occasionally drop the output.

     

    We ended up changing the way we logged by writing debug data in text format to a threadsafe ring buffer and have a background thread burst the logged data to a textfile periodically, and that would transition to a new file every midnight.


  4. 5 minutes ago, Mike Warren said:

    Thanks for the reply Lars.

    Am I mistaken that I can't find OnSetEditText in FireMonkey? It seems to be VCL only.

    Argh, Mike - my bad.  I was speaking from a VCL point of view - not noticing that you posted in the FMX section.  Not the first time I've made that mistake.


  5. Threads are about parallel/background work, but after invoking a task, you could in theory use ITask.Wait to stop the main thread while waiting for it to complete - but then you might as well execute the code from the main thread instead of creating other threads. Also, if the thread gets stuck, your main thread would be stuck. 

     

    It is better to use parallel threads and in the main thread receive signal events for when the background thread succeeds/completes/fails. 

     

    Threads are not hard when you understand them and the best practices around the use of them - but gaining that knowledge can be a challenge. 

    Read the theory, study the examples, and try it out.

    • Like 2

  6. Searching the 11.x source:
    image.thumb.png.165170d40d4d09e65a6d1616b91854cb.png

     

    So - there is some compiler magic involved somewhere with the BlockWrite proc.

    In System.pas, below line 3000, you find the comment: { Procedures and functions that need compiler magic }

    and a long list of funcs and procs. _BlockWrite is in that section.

     

    Map file says
    0001:0000BE10       System.@BlockWrite
     

    Is it a pointer to the procedure which is set up somewhere by the compiler/RTL?


  7. I would have said that this is a manual task, as components or libaries might not be easily identifiable.

     

    In theory, you could write something that scanned the source files and picked out copyright messages, but the list would probably be ripe with duplicates, and have many missing entries. On the other hand - if the scanning could be done out-of-project and connect units to a vendor once and for all and allow for manual tidying, then it would basically be about scanning the map file post build, and create and link a resource text (or JSON or XML) with the SBOM info. 

     

    Sounds like a development opportunity for a creative person with time to spare.


  8. @Bart Verbakel Is it a file used only by your application(s) - i.e. are you in control of production and consumption of the file?

    In that case, you have the alternative to modernize the file structure to f.x. JSON to support unicode and additional/optional fields.

     

    If you stay on your Record format, you need to do explicit conversions between your shortstrings and other strings in the system.

     

    MessageDlg(

     String( F1Pool.Deelnemer[High(F1Pool.Deelnemer)].Teamnaam )

     + ' succesfully added!', mtInformation, [mbOk], 0);  // Should silence the W1057

×