Jump to content

Henry Olive

Members
  • Content Count

    325
  • Joined

  • Last visited

Everything posted by Henry Olive

  1. Henry Olive

    IB -> FB Data Transfer

    I wish everyone a healthy day. I Converted my IB Database to FB w/o any problem (i was surprised, that was very easy) Now i need to transfer the datas from IB to FB What is the easiest way to do that ? Thank You
  2. Henry Olive

    Round

    Good Day, var a,b : Double a:= 66,3333 b:= 1,5 c:= a* b ( Delphi shows c:= 99,5, actually c should be 99,49995 ) How can i get exact result ( 99,49995 ) ? Thank You
  3. Good Day, I need to find out if there is SUNDAY between 2 dates For example : StartDate = 06/23/2023 , EndDate = 06/26/2023 ( Result = 1 , Because 06/25/2023 = Sunday ) StartDate = 06/23/2023 , EndDate = 07/03/2023 ( Result = 2 , Because there are 2 Sundays ) StartDate = 06/23/2023 , EndDate = 06/24/2023 ( Result = 0 ) Thank You
  4. Good Day, How can i sort (descending) a table on a calculated field ? Thank You
  5. Henry Olive

    Debug Break Point

    Good Day, Delphi 10.3 When i compile or build my program i cant see in some code lines small BLUE POINT on the most left side of code screen so program doesnt read the lines with out blue point (I didnt change anything in Tools/Options.... etc.) . MyTable.Close; // There is blue point MyTable.Open; // No blue point Thank You
  6. Henry Olive

    Round

    Thank you SO much David, KodeZwerg, Programmer I solved the problem.
  7. Henry Olive

    Round

    Thank you so much Peter I dont convert anything My Code = a:= MyQuery.FieldByName('TOTAL').asFloat; (which is 66,3333.-) b:= MyQuery.FieldByName('RATIO').asFloat; (Which is 1,50 ); c:= a * b; // In Debug i see c as 99,50 instead of 99,4999 MyTable.Edit; MyTableBENF.asFloat := c; // i was expecting to see in mytable's BENF field 99,49 not 99,50 (BENF field in firebird3 database is as Numeric(15,2) (In Delphi my table's releated field's Currency proporties = True)
  8. Good Day, I add Customer No & Customer Name in a combobox like below Combobox1.Items.AddObject(SQLQuery1.Fields[1].asString, Pointer(SQLQuery1.Fields[1].asInteger)); I want to make CutNo=1 record in the combobox selected (I mean, combobox1.text = CustNo=1 record's Customer Name) but i get, Identifier expected but 'OBJECT' found error msg. Combobox1.ItemIndex := Integer(Combobox1.Items.Object[Combobox1.ItemIndex]); Could someone please help Thank You
  9. Henry Olive

    Combobox1.Items.AddObject(....)

    Thank you so much Lajos, DelphiUdit, Programmer, David David, Combobox1.Text.AsInteger doesnt compile in D10.3
  10. Good Day, Procedure TForm1.MyProc; begin .... end; TForm1..DBGrid2DblClick(Sender: TObject); begin MyProc = Nil; // i want to disable myproc procedure, how? ....... MyProc:=MyProc; // i want to enable myproc procedure, how? end; Thank You
  11. Good Day, var Str,SubStr : String; Str := could be '100' or Str := could be '100,101' or Str := could be '100,101,102' ..... I have another variable which indicates delete number SubStr :=100 ( this could be 101 or 102 ...) I want to delete SubStr from Str that is if Str = 100 then Result :='' if Str = 100,101 then Result :='101' if Str = 100,101,102 then Result :='101,102' If SubStr ='101' then then Result := '100,102' If SubStr ='102' then then Result := '100,101 Could someone please show me how to do ? Thank You
  12. Henry Olive

    Delete substring from a string

    Sorry, i should have informed that they are always separated by commas Thank you so much aehimself, programmer, David
  13. Henry Olive

    Pos

    Good Day, MyTable looks like below DOCNO 10-01 10-01 20-02 20-02 At the end I want to get ('10-01,20-02') // Every SINGLE DocNo with below code i'm getting '10-01,20-02,20-02' ( 20-02 should have been SINGLE ) DocNos :='' CDS1.First; while not CDS1.Eof do begin if DocNos ='' then DocNos := CDS1DOCNO.asString else if Pos(DocNos, CDS1DOCNO.AsString) = 0 then DocNos := DocNos + ','+ CDS1DOCNO.AsString; CDS1.Next; end; What am i doing wrong ? Thank You
  14. Henry Olive

    Pos

    Thank you so much David, actually my code is like yours but when i write here i made a mistake, otherwide Delphi doesnt compile
  15. Henry Olive

    Pos

    Thank you so much Aehimself
  16. Henry Olive

    Pos

    Thank you so much Programmer
  17. Henry Olive

    Pos

    Thank You so much Stano I just found out Contains (StrUtils) I solved my problem with Contains instead of Pos
  18. Henry Olive

    Pos

    Thank You Stano No it is not a DBTable, CDS1 table is a Query Result
  19. Henry Olive

    Split String

    Good Day, Delphi 10.3 Below codes works w/o any problem Edit1.Text := '22-1568'; Edit2.Text := SplitString(Edit1.Text,'-')[0]; // result= 22 Edit3.Text := SplitString(Edit1.Text,'-')[1] // result:= 1568 When i try the same code like below ( *There is StrUtils in Uses* ) I'm getting Not enough actual parameters error msg. Str := CDS1.FieldByName('DOCNO').asString; // which is '22-1568' LeftStr := SplitString(Str,'-') [0]; RightStr := SplitString(Str,'-') [1]; What am i doing wrong ? Thank You
  20. Henry Olive

    Split String

    Thank You SO SO SO MUCH Uwe, Lars, Programmer I solved the problem as below 1- In Uses, I changed StrUtils to System.StrUtils in USES 2- In Uses, I moved QRCtrls, QuickRpt units BEFORE System.StrUtils (as Uwe said.) 3- In codes, I used System.StrUtils.SplitString( ... , ... ) (as Lars said.)
  21. Henry Olive

    Split String

    Thank you so much Lars I tried System.StrUtils.SplitString('-', MyStr) [0]; but still get the same error If i remove QRCtrls, QuickRpt from Uses, below codes work fine w/o any error MyStr := CDS1.DataSet.FieldByName('DOCNO').AsString; MyLeftStr := SplitString('-',MyStr) [0]; MyRightStr := SplitString('-',MyStr) [1];
  22. Henry Olive

    Split String

    Thank you so much Uwe interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ComCtrls, DBCtrls, ToolWin, StdCtrls, ExtCtrls, Mask, Buttons, Grids, DBGrids, Menus, DB, DBClient,TypInfo, QRCtrls, QuickRpt, Math, FMTBcd, SqlExpr, Provider, System.Actions, Vcl.ActnList; type ..... implementation {$R *.dfm} Uses System.StrUtils, Udm, UItemCard, ULookUp;
  23. Henry Olive

    Split String

    Thank you SO MUCH Uwe, i'm really very very sorry for taking your time I added StrUtils at the end of the main Uses Clause but i get the same error I deleted StrUtils in the main Uses Clause and added uses of the implementation section but i get the same error
  24. Henry Olive

    Split String

    Thank you SO MUCH Lars, Uwe After i get the same error with Lars's suggestion i noticed below situation When i move my mouse cursor on SplitString in Delphi Editor, i saw Delphi shows Quick Report's SplitString In my uses there are QRCtrls, QuickRpt, StrUtils and i need to use a quickreport in that Unit. I also tried to change StrUtils in Uses to System.StrUtils but still get the same error What should i do now ?
  25. Henry Olive

    Split String

    Thank you so much Uwe I changed the var names to var MyStr, LeftMyStr, RightMyStr but i still get the same error msg. Thank You
×