Jump to content

programmerdelphi2k

Members
  • Content Count

    1406
  • Joined

  • Last visited

  • Days Won

    22

Everything posted by programmerdelphi2k

  1. programmerdelphi2k

    IBX & FireDAC, Change Views

    in FireDAC you can try see the "Delta" property: https://docwiki.embarcadero.com/Libraries/Sydney/en/FireDAC.Comp.DataSet.TFDDataSet.Delta
  2. programmerdelphi2k

    Quite confused about how to save a project

    basically, you save each file after create it. ... later, you can use "Save ALL" if more than 1 file was changed, else use "Save" if just 1 (current on editor) if you want change the file name, just do it on Project Manager tree, press F2 or Rename menu item on rightclick... now "save" it again. PS: Understand "Save AS" as "Make a copy and use it as the official file for this project". Thus, you will have the "old file" as a "backup with old code so far...", got it?
  3. programmerdelphi2k

    Displaying an independent background in a Delphi app

    would be: 1 bitmap on background... and +1 other image over it? and if you draw 1st bitmap on "canvas of form using OnPaint()"?
  4. programmerdelphi2k

    Round

    to "force" usage +decimals you can try this: varX * ( varY + 0.00000) should sum decimals places on resulted
  5. programmerdelphi2k

    Round

    Does Python have an RTL and Delphi Object PASCAL forum? the question remains
  6. programmerdelphi2k

    Round

    And for those who are "blind" due to constant and innate bad temper... FDQUERY ->> accesses a data source in a DATABASE!
  7. programmerdelphi2k

    Round

  8. programmerdelphi2k

    Round

    Firebird/InterBase® converts the columns as follows: Definition Data type Created Decimal(1)-Decimal(4) Small Integer Decimal(5)-Decimal(9) Integer Decimal(10)-Decimal(18) Int (64) Note that if a DECIMAL(5) data type is specified, it is actually possible to store a value as high as a DECIMAL(9) because Firebird/InterBase® uses the smallest available data type to hold the value. For a DECIMAL(5) column, this is an INTEGER, which can hold a value as high as a DECIMAL(9). Enhancement in precision of calculations with NUMERIC/DECIMAL (Firebird 4.0) Supported in IBExpert since version 2017.12.03. Source: https://github.com/FirebirdSQL/firebird/blob/master/doc/sql.extensions/README.data_types Function Maximum precision of NUMERIC and DECIMAL data types is increased to 34 digits. Author Alex Peshkoff <peshkoff@mail.ru> Syntax rules NUMERIC ( P {, N} ) DECIMAL ( P {, N} ) where P is precision (P <= 34, was limited prior with 18 digits) and N is optional number of digits after decimal separator (as before). Storage 128-bit, format according to IEEE 754. Example(s) 1. DECLARE VARIABLE VAR1 DECIMAL(25); 2. CREATE TABLE TABLE1 (FIELD1 NUMERIC(34, 17)); Note(s) Numerics with precision less than 19 digits use SMALLINT, INTEGER, BIGINT or DOUBLE PRECISION as base datatype depending upon number of digits and dialect. When precision is between 19 and 34 digits DECFLOAT(34) is used for it. Actual precision is always increased to 34 digits. For complex calculations such digits are casted (internally, in trivial way) to DECFLOAT(34) and the result of various math (log, exp, etc.) and aggregate functions using high precision numeric argument is DECFLOAT(34). -------- more info in: https://www.ibexpert.net/ibe/pmwiki.php?n=Doc.DefinitionNUMERICDECIMAL
  9. programmerdelphi2k

    Round

    Guys, I think the problem reported above is more related to the Database than to Delphi itself and its adventures! We must remember that the numbers, as reported above, are stored binary, not decimal! And, when you define a field of type NUMERIC/DECIMAL 15x2, then, we must remember the range of the smallest and largest value that can be stored in this field! For that, you can check the Database or Delphi documentation. See the example using Firebird 4.02, I created 6 fields: and using the formula from the first post, see the results: implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); begin FDQuery1.Open; end; procedure TForm1.Button2Click(Sender: TObject); var a, b, c: double; begin a := 66.3333; b := 1.5; c := a * b; Edit1.Text := c.ToString; // FDQuery1.Append; FDQuery1.Fields[0].AsFloat := c; FDQuery1.Fields[1].AsFloat := c; FDQuery1.Fields[2].AsFloat := c; FDQuery1.Fields[3].AsFloat := c; FDQuery1.Fields[4].AsFloat := c; FDQuery1.Fields[5].AsFloat := c; FDQuery1.Post; end; procedure TForm1.FormCreate(Sender: TObject); begin FDConnection1.Close; end; end. NOTE: Now, YOU can use "DisplayFormat" to show your value in another "MASK" for example: 0.##, ###,00 etc... but the "real value stored on database" is another of course!
  10. programmerdelphi2k

    Doubts about THorzScrollBox operation

    hi @Drummer1972 here a Guitarman +/- try some like this: my sample is in Delphi ... sorry Im not CBuilder ! type TForm1 = class(TForm) HorzScrollBox1: THorzScrollBox; rectGreen: TRectangle; rectRed: TRectangle; rectBlue: TRectangle; Memo1: TMemo; rectOrchid: TRectangle; procedure HorzScrollBox1DragOver(Sender: TObject; const Data: TDragObject; const Point: TPointF; var Operation: TDragOperation); procedure HorzScrollBox1DragDrop(Sender: TObject; const Data: TDragObject; const Point: TPointF); procedure FormCreate(Sender: TObject); end; var Form1: TForm1; implementation {$R *.fmx} type TArrRectangles = TArray<TRectangle>; var LArrRectangles: TArrRectangles; procedure TForm1.FormCreate(Sender: TObject); var j : single; LText : string; LRectangle: TRectangle; begin LArrRectangles := []; // j := 0; // for var X: integer := 0 to (HorzScrollBox1.Content.ChildrenCount - 1) do if (HorzScrollBox1.Content.Children.Items[X] is TRectangle) then // rectangles in HorzScrollBox1 begin LRectangle := TRectangle(HorzScrollBox1.Content.Children.Items[X]); LRectangle.Margins.Left := 5; // space to working with Drag...Drop it! LRectangle.DragMode := TDragMode.dmAutomatic; LRectangle.Tag := X; LRectangle.Position.X := j; LRectangle.Align := TAlignLayout.Left; // all to left... LArrRectangles := LArrRectangles + [LRectangle]; j := j + LRectangle.Width + 1; // next rectangle position LText := LText + LRectangle.Name + ' ' + LRectangle.Position.X.ToString + ' ' + LRectangle.Tag.ToString + slinebreak; end; // Memo1.Lines.Add(LText); // if (length(LArrRectangles) > 0) then // else there is no rectangles on HorzScrollBolx1 HorzScrollBox1.DragMode := TDragMode.dmAutomatic; end; procedure TForm1.HorzScrollBox1DragDrop(Sender: TObject; const Data: TDragObject; const Point: TPointF); begin if (Data.Source is TRectangle) then LArrRectangles[TRectangle(Data.Source).Tag].Position.X := Application.MainForm.ScreenToClient(Screen.MousePos).X; // rect in new position... end; procedure TForm1.HorzScrollBox1DragOver(Sender: TObject; const Data: TDragObject; const Point: TPointF; var Operation: TDragOperation); begin if (Data.Source is TRectangle) then Operation := TDragOperation.Move; end; end.
  11. programmerdelphi2k

    Collapse of the programme

    when in designtime or runtime?
  12. programmerdelphi2k

    Collapse of the programme

    at first, a backup full of your complete project folder: did you try uninstall the EurekaLog for try if this error occurs ? (Delphi is more malleable for detecting some types of errors, so some may pass testing at this point...) did try uninstall your UniDAC components and try load (same that other errors occurs) ? (I think you use the UniDAC no? and other components, would it be possible to remove them for testing?) It's easier to test Delphi without any other interference... (it's enough to cause errors 😂 ) You could try to open the form in text mode and copy everything to a plain text editor, and paste it again, this way, if there are any ghost characters, I believe it can be removed in this action! I'm thinking it might be a problem with a corrupted file, okay?
  13. programmerdelphi2k

    How to get Debug AND Release directories after building a project

    use Project Options -> Building -> Delphi Compiler -> ALL CONFIGURATION 32 or 64 or ANDROID or Whatever and use .\$(Platform)\$(Config) as said above
  14. programmerdelphi2k

    Unable to execute '"C:\Program Files\Java\jdk-17.0.1\bin\java.exe" 

    Verify if exists more than 1 java in your mswin
  15. hi People, I don't know what to think to solve the current problem I got myself into! From the beginning... doing some tests with the "SetWindowPos(...)" MSWin-API function, I realized that my new forms created and called from the main form, using the "SHOW" procedure, were no longer being in the background!!! That is, the new forms are always in the foreground, regardless of whether or not the "FormStyle = fsStayOnTop" is set!!!! to clarify further: all new forms are "FormStyle=fsNormal"... ALL, either formMain, or a formSecond called in formMain! none of the form properties (at all) were changed, it's all default by Delphi. nothing nothing nothing is being changed The new VCL projects are creating forms always in TOPMOST after my tests with the function call "SetWindowPos(...)" that I made in a test project!!! After a moment of total madness (laughs), I tried checking the Embarcadero Registry (HLM/HCU) to see if any properties were defined during the tests, but I didn't find anything strange.... I tried to check some configuration file in the Embarcadero folder (in the user's system folders), but I didn't find anything that gave any information either! Finally, I went to the extreme and completely uninstalled RAD Studio, deleted folders, files and keys in the Registry... everything! And I did a reinstall from scratch! But nothing solved it... my new forms still having the TOPMOST property, this way, creating and calling the sub-forms through the "SHOW" procedure, always placing the sub-forms on the application's main form! Finally, my suspicion is that I bugged MSWindows and now Delphi will always be using create forms as TOPMOST... Has anyone been through this situation or can indicate a way to reverse this situation? watch the two videos using same code Video 1: before tests with SetWindowPos Form1 (main form) call Form2 (second form) using Form2.SHOW; clicking in Form2, it came to front clicking in Form1, it came to front OK!!! all it's working! Video 2: after tests with SetWindowPos Form1 (main form) call Form2 (second form) using Form2.SHOW; clicking in Form2, it came to front clicking in Form1, it DONT came to front now FORM2 is always on TOP.... 😭 Here the code used in my tests, nothing more than this 2 forms in tests (main and second forms) had all properties default and none code, basically empty! this code was in my Form1 procedure TMeuFormParaTest.Button1Click(Sender: TObject); begin SetWindowPos(Handle, HWND_TOPMOST, Left, Top, Width, Height, SWP_NOACTIVATE or SWP_NOMOVE or SWP_NOSIZE); end; procedure TMeuFormParaTest.Button2Click(Sender: TObject); begin SetWindowPos(Handle, HWND_BOTTOM, Left, Top, Width, Height, SWP_NOACTIVATE or SWP_NOMOVE or SWP_NOSIZE); end; after this code, all changed in my Delphi... new projects have its forms using "FormXXX.SHOW" as TOPMOST, and over my form caller (normally my Form-Main) AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH! Im crazy with this! attached my project test with 2 forms and almost none code! VCL_Forms_always_TOPMOST_Now_in_New_Projects.zip ...
  16. hi @Pat Foley the real problem was: Application.MainFormOnTaskbar = true In my projects, the setting "Application.MainFormOnTaskbar := True" was not used by default, the same way it is not used in FireMonkey!!!! However, all of a sudden, I realized that this had been changed in the creation of my new form, so it caused all this mental confusion I found myself in. And, to make matters worse, I was more focused on the "SetWindowPos(...)" function than on any other possible cause of the fact itself. This way, I couldn't think of another possible cause, and, I was putting the blame entirely on the "SetWindowPos" function, which, I now know, was not the real culprit of all this fuss. But I'm still looking to leave everything as it was before...
  17. SORRY BY MY SHAME 😩 I never had change this line (ADDed or SUBTRACTed ) before I dont know how this happens at end... begin Application.Initialize; // Application.MainFormOnTaskbar := True; // NOW WORKS... Application.CreateForm(TForm1, Form1); Application.Run; end.
  18. @Remy Lebeau in my IDE or forms NOTHING WAS CHANGED since last project!!! the behaviour appears after a test with SetWindowPos above; but I dont changed nothing when creating a new project... I just added a new form (second form) and calling it in my button1 in form1 (main) all as before look
  19. hello @Remy Lebeau some help please if possible?
  20. hi @Uwe Raabe but the weird is: I dont change nothing nothing nothing in my IDE (11.3 only one in my MSWin), project, etc... I just useD the SetWindowPos(...) as above... my projects (source-views) is never touched at all I think that some in MSWindows was changed and now Delphi use it as default ( I never see this before +20 years) begin Application.Initialize; Application.MainFormOnTaskbar := True; Application.CreateForm(TForm1, Form1); Application.Run; end.
  21. NOTE: in FMX all still ok! using FormXX_Fmx.SHOW all works like expected....
  22. programmerdelphi2k

    DelphiFMX4Python

    @limelect this help you? https://developer.hpe.com/blog/managing-multiple-instances-of-python-in-microsoft-windows/
  23. programmerdelphi2k

    Component installation.

    to compile the DBProDemo.dpr add in your Project->Options->Delphi Compiler->Search Path -->> where is the DCUs files from new package // SBProDemo... unit Main; { ...$I DELPHIAREA.INC } // <------------- interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, Menus, SBPro, {$IFDEF COMPILER4_UP} ImgList, {$ENDIF} Gauges, // <------------- ExtCtrls, StdCtrls, System.ImageList, Vcl.ImgList; // <------------- not problem now!!! type TForm1 = class(TForm) StatusBarPro1: TStatusBarPro;
  24. programmerdelphi2k

    Component installation.

    @Prem1 Im using RAD 11.3 Arch, and your files was installed without errors: you need: Create a new Package VCL -> File New-Packages Add your 2 units into this package: SBPro.pas, SBProReg.pas (was not necessary any other units from DelphiArea site) Add the "DESIGNIDE.DCP" in "requires" session: ..\<<RAD-dir>>\LIB\Win32\Release Add the "ToolAPI" path in your project "Search" --> Project->Options->Delphi Compiler->Search Path ( debug / release mode) build and install it!!!
  25. programmerdelphi2k

    Multiple Rows of Tabs in a TabControl (or "<" ">" buttons)

    did you see this https://stackoverflow.com/questions/32191474/multiline-tabs-in-an-fmx-ttabcontrol
×