Jump to content

Juan C.Cilleruelo

Members
  • Content Count

    18
  • Joined

  • Last visited

Community Reputation

7 Neutral

Technical Information

  • Delphi-Version
    Delphi 10.2 Tokyo

Recent Profile Visitors

117 profile views
  1. All the code is from somebody who didn't understand, absolutely, the way exceptions work. This structure is not a punctual case in the code I'm revisiting, is a constant. Is on all the methods. I think that this type of wrong conception code is more than 30% of the whole code. It's because I commented it like 'paranoid code'.
  2. Maybe, catch the exception with the intention of re-raise the same one, is useful for someone, but... the "Exit;" instruction too?
  3. If anyone has not noticed, the previous structure is, in code, equivalent to: WriteLicenseData;
  4. try WriteLicenseData; except on exception do begin raise; Exit; end; end;
  5. Juan C.Cilleruelo

    How to know that a file is not used by another program?

    This was my first option, effectively, but, how to do this in Mac OS X?
  6. Juan C.Cilleruelo

    How to know that a file is not used by another program?

    Each error waits one second. I think is absurd repeat without allow the other process finish.
  7. Juan C.Cilleruelo

    How to know that a file is not used by another program?

    This is my current code. I think now is working well. Any idea! Thanks to all. ...... CountErrors := 0; while not (TFile.Exists(PNG_FileName) or (CountErrors > 5)) do begin Inc(CountErrors); Sleep(1000); end; Sleep(1000); CountErrors := 0; SuccessLoad := False; while (not SuccessLoad) or (CountErrors > 10) do begin try BlobField.LoadFromFile(PNG_FileName); SuccessLoad := True; except on EFOpenError do begin SuccessLoad := False; Inc(CountErrors); Sleep(1000); end; end; end; .....
  8. Juan C.Cilleruelo

    How to know that a file is not used by another program?

    The external program is OpenSCAD. I can't control how it works. The generated file exists during all the process. I can't control this.
  9. My application generates a data file with instructions to generate a graphic file and after call an external program that processes this information and generates the graphic file. Next, my program, that is waiting until the graphic file exists, takes this graphic file and incorporates it to his database. The problem is the the time that the external application take to processing the data file. This time can be very large. An sometimes, my program traying to get the resulting file meanwhile the external program is processing it. This becomes in an OS exception. Can I ask to the OS, if the file I want to take is been still processing by another application? The program is cross platform, because of this I can't call the external application waiting to his finallization. And of course, if the solution is for crossplatform, more better. Thank in advance.
  10. Juan C.Cilleruelo

    Which type will hold better a TBCDField value?

    In this case, if for measurements but is the same type of data I use for all economic values. I read an EU document in which he explains how to treat with decimal values in operations with Euro. It's easy: You always should take three decimals for all operations and finally show a "round half up" function to two decimals when you show or print the results. I can't remember where is this document, but if you need it you can search on the web. reference for "Round Half Up": https://en.wikipedia.org/wiki/Rounding#Types_of_rounding
  11. Juan C.Cilleruelo

    Which type will hold better a TBCDField value?

    Thank you all! Working again! The final solution was finally, use Currency. I can take this TFields AsCurrency and this works well. The problem comes from a modify in all the program. I had all the measures for the furniture in millimetres. This is a good thing for woodworking, but I have now a new customer that need my program for modelling complex things for 3D printing and he needs until hundredths of millimetres (two decimals). Solved.
  12. Juan C.Cilleruelo

    Which type will hold better a TBCDField value?

    Read the thread, please! Your response is not related to the theme! It's only the first thing you found in a google search. What kind of help is this? What solves?
  13. Juan C.Cilleruelo

    Which type will hold better a TBCDField value?

    Attila: This is not the problem. The database is well defined. Read the previous entries, please.
  14. Juan C.Cilleruelo

    Which type will hold better a TBCDField value?

    I understand that if instead use MyField.AsBCD, I use MyField.AsCurrency, I don't loss precision, because is his internal representation. Do you think? I'm going to do some proves.
  15. Juan C.Cilleruelo

    Which type will hold better a TBCDField value?

    Where is this info?: TBCDField converts the data from a BCD value to a currency value when it fetches the data from the database table, and converts it from a currency value to a binary-coded decimal value when it posts the data.
×