Jump to content

Stano

Members
  • Content Count

    882
  • Joined

  • Last visited

  • Days Won

    7

Everything posted by Stano

  1. If you're bored, do it. Learning is a strong argument You still don't listen to David I personally don't know what he's talking about. The issue is beyond my comprehension
  2. I'd rather describe it again. I was dealing with a bulk write to a JSON file. Previously, I wrote down each item separately. It was unbearable. The acceleration was enormous. From a few seconds to "nothing". All my forms have been closing for a very long time. 5 -> 10 sec. That's when I realized it was caused by an incorrect entry in JSON. I go through the whole form and write to JSON for the affected components. Now only a small adjustment in one place. Forms close immediately. This is unwanted optimization. Maybe I could find profilers. I only mentioned it for variety. I'm not a programmer. I'm just playing with him
  3. You may have noticed my post "unwanted optimization". I knew about the narrowed place. But I didn't know how to do it. I thought that must be the case.
  4. Stano

    Date Sorting Odd

    DBGrid certainly has the ability to customize the data. Use it. Then discard the ORDER BY section from SQL
  5. Again, only from a wise book. I agreed with that. Check everyone enter the routine (arguments) the result sent from the function
  6. Stano

    Macro substitution in Locate

    For me, the question is quite unclear. I tried to give at least some answer. if fdqA.Locate (AFieldName, cPayee), []) then ShowMessage ('located!') else ShowMessage ('Failed!');
  7. Stano

    Macro substitution in Locate

    I created a function for this, which has a field name in the argument.
  8. Stano

    Is Delphi still taught in schools?

    Not me personally. I do not use it. This is stated in the license. There are enough topics in which they have solved this problem. In relation to D10.3
  9. Stano

    Is Delphi still taught in schools?

    Let's look at it through the eyes of a teacher: Will I learn Pascal or C syntax? Definitely Pascal. It's designed for that. Among other things. What do I have available? Since it's a school, it's free! LAZARUS - is handy and does not cause problems Delphi - is a huge hebedo. I have to reinstall it every year That is all.
  10. Stano

    SQL Update Case When

    I looked in the help. The update part is not finished with ";"
  11. Stano

    SQL Update Case When

    Since I don't do it, I can only guess. I only work with Firebird. See help. It should be behind the penultimate end ";" ? I have nothing more to say.
  12. Stano

    SQL Update Case When

    I apologise. Such a mistake Case When SHAREHOLDER='Y' then (BRUTSALARY * :EMPPORTION /100) * :TMONTH End AS MYRESULT
  13. Stano

    SQL Update Case When

    Case When SHAREHOLDER='Y' then (BRUTSALARY * :EMPPORTION /100) * :TMONTH AS MYRESULT End I assume this.
  14. Stano

    Is Delphi still taught in schools?

    It is clear from the article that this is the teacher's decision. The reason is simple. Pascal was created for this purpose. That's why I can read it too. But C syntax does not!
  15. Move the cursor to the appropriate word (eg sin) and wait a bit. A pop-up window will tell you in which unit it is located.
  16. Stano

    SQL

    So use it as a subselect.
  17. Stano

    SQL

    Using WITH. Somehow like this. If the unknown DB supports it WITH TB AS (SELECT EMPNO,EMPNAME, PRIORTAXBASE, BRUTSALARY, Case When SHAREHOLDER='Y' then (PRIORTAXBASE + BRUTSALARY) When RETIRED='Y' then (PRIORTAXBASE + BRUTSALARY)- ((PRIORTAXBASE + BRUTSALARY) * 4 /100) + When (SHAREHOLDER IS NULL or SHAREHOLDER='N') then (PRIORTAXBASE + BRUTSALARY) - ((PRIORTAXBASE + BRUTSALARY) * 0.18) end as TAXBASE ) SELECT Case When TAXBASE <= 30000 then TAXBASE * 20 When TAXBASE >30000 and TAXBASE <=50000 then TAXBASE * 30 .... end as TAXTOTAL FROM TB
  18. I agree. There is also a note that this can be canceled. My data has been around for a long time
  19. Stano

    Interbase Get Days count of a month

    For Firebird First Day of The Date: SELECT CAST(:DATA AS DATE) - EXTRACT(DAY FROM CAST(:DATA AS DATE)) + 1 FROM RDB$DATABASE LAST DAY OF THE DATE: SELECT CAST(:DATA AS DATE) - EXTRACT(DAY FROM CAST(:DATA AS DATE)) + 32 - EXTRACT(DAY FROM (CAST(:DATA AS DATE) - EXTRACT(DAY FROM CAST(:DATA AS DATE)) + 32)) FROM RDB$DATABASE
  20. OT: There is also "unwanted" optimization. My fresh case. Writing to JSON file. Item by item. For 86 items, it was over 7 seconds. It made me act. So I edited it and I write all the items at once. I realized that when I close the form, I go through it and write it to JSON. So he took advantage of the change, and had everything written down at once. I don't have to wait for the form to close at once. It's immediate In debug mode. I couldn't figure out why the forms were closing for so long.
  21. I'm trying to create a class that returns different types of components. Specifically, it is a TMS TDBxxSource for TDBPlanner. All are descendants of TDBItems. Use for example in SpinEdit, which would serve all TDBxxSource. There is a separate SpinEdit for each TDBxxSource. I only want one OnClick event for them. The class must return, according to the index, the specific TDBxxSource. Not TDBItems, because I would have to cast it in OnClick. This is nonsense. The class would lose its meaning. Example of use procedure TfrmPlannerRole.advsedDayScaleChange(Sender: TObject); var SpinEdit: TAdvSpinEdit; begin SpinEdit := TAdvSpinEdit(Sender); MyClass.DBSource(5).VariousTypes := SpinEdit.Value; end; Originally at https://forum.delphi.cz/index.php/topic,17355.0.html There is silence.
  22. I tried to do it. I had a problem that I always needed a different component. I solve it using case .. of. In a separate class.
  23. Even those who know Slovak did not understand I already have a solution. The topic is closed to me. Thank you all for your willingness to help me.
×