Delphi

59K

Solutions

17K

Contributors

Delphi is the most powerful Object Pascal IDE and component library for cross-platform Native App Development with flexible Cloud services and broad IoT connectivity. It provides powerful VCL controls for Windows 10 and enables FMX development for Windows, Mac and Mobile. Delphi is your choice for ultrafast Enterprise Strong Development™. Look for increased memory for large projects, extended multi-monitor support, improved Object Inspector and much more. Delphi is 5x faster for development and deployment across multiple desktop, mobile, cloud and database platforms including 32-bit and 64-bit Windows 10.

Share tech news, updates, or what's on your mind.

Sign up to Post

Hi can you tell me how to add Combo box in to Adv String grid
Ex
i need to add Col 1 Combobox 1, Col2 need to add Combobox 2
0
Hi

following scenario:
- Delphi 10.1 Berlin
- SQL Server Database with a table "myTable", two columns "colA" and "colB"
- Open the table with SELECT colA, colB, colA * colB AS multiplyResult FROM myTable
- Form with a tDbGrid, showing all the columns

Know my question: I want to modify colA or colB (in the tDnGrid) and want that the result is displayed immediately. Is there a possibility to refresh only that calculated value without calling the refresh-method of the query (after the refresh I have to locate the row again and if it is a large table it is a performance-problem)?

Thanks for your hints, Peter
0
I am looking for an easy way to verify that the PC where my program is running is connected to the Internet.
The program is mine and coded in Delphi XE
Thanks
0
When I try the program below I get
error  "OLE error 800A03EC"
When I put the formula
=SOMMEN.ALS(R[-8]K:R[-2]K;R[-8]K[-1]:R[-2]K[-1];">100";R[-8]K[-1]:R[-2]K[-1];"<200")
manualy in the Excel sheet on cell (11,2) everyting is ok.
In the attachment the test.xlsx file.

===================

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ComObj, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var ExcelApp : variant;
begin
  ExcelApp:= CreateOleObject('Excel.Application');
  ExcelApp.DisplayAlerts := False;
  ExcelApp.Workbooks.Open('c:\users\myself\temp\test.xlsx');
  //"=SOMMEN.ALS" is Dutch version of "=SUMIFS"
  ExcelApp.ActiveWorkbook.WorkSheets[1].Cells(11,2):='=SOMMEN.ALS(R[-8]K:R[-2]K;R[-8]K[-1]:R[-2]K[-1];">100";R[-8]K[-1]:R[-2]K[-1];"<200")';
  ExcelApp.Visible:=True;
end;

end.
test.xlsx
0
I need to get a Token from a WebSite.
I have attached a C# program, which I need to translate to Delphi.
OAuthFromWindowsApp.zip which you can download from here: ftp://compmark.biz/Authorization/OAuthFromWindowsApp.zip
I am playing around with it, but am not getting anywhere.

I haven't used Experts Exchange for a long time and I can't see, how to give points anymore.

I would like to allocate 1000 points for a solution if this is still valid. Or let me know if you want more.
I am very negotiable on this.
0
Hello,
I import data from table paradox to text file in timer wish the interval=one hour i want that my application run without form i put this instruction before Application.Run (Application.ShowMainForm := False) but i can't close the execution because i have not a form any solution please ,I m using Delphi 7(sorry for my bad english)
0
Hello,
I import data from table paradox to text file in timer wish the interval=one hour i want that my application run without form i put this instruction before Application.Run (Application.ShowMainForm := False) but i can't close the execution because i have not a form any solution please ,I m using Delphi 7(sorry for my bad english)
0
I want to have the background color of a particular TStringGrid cell to be for example Red when I write a string in that cell.
What is the instruction I have to place in the TStringGrid OnDrawCell event ?
0
Hi all,

I have Delphi XE7 and MSSQL 2008r2 . Have quiet a large table here (50.000 records) . I have a DateTime field in MSSQL.

I have a Adoquery in delphi with parameter. :mydate ftDatetime , NumericScale 3 , Precision 23 , Size 16 , Value Null (default , I've let Delphi populate ) .

Problem is I provide the query the datetime from DateTimePicker1 like this :

  if ViewQuery.Active then ViewQuery.Close;
  ViewQuery.Parameters.ParamByName('mydate').Value:=DateTimePicker1.Date;
  ViewQuery.Open;

Open in new window


TimeOut after 30 secs .

I solved it like this , changed the parameter :mydate to string , NumericScale 0 , Precision 0 , Size = -1 , Value Null .

  if ViewQuery.Active then ViewQuery.Close;
  ViewQuery.Parameters.ParamByName('mydate').Value:=inttostr(yearof(DateTimePicker1.Date))+'-'+inttostr(monthof(DatetimePicker1.Date))+'-'+inttostr(dayof(DateTimePicker1.Date));
  ViewQuery.Open;

Open in new window


I send the date to SQL exactly like it is stored internally . This is lightning fast .

Can someone explain to me , why is it not working as fast when I specify the parameter as ftDateTime?

Regards
Robert
0
Can I use Delphi 10.2.2  FireDac TFDLocalSql   with Firebird ?
0
I had this question after viewing Image On A TButton.

I have the same problem, but, I don't know why, few days ago it worked until I did something wrong in Project Option or somewhere, I presume,and then no chanche to see a TButton with an image inside in my app (only button). In a new app it works (Win10 Rad Delphi 10,2) May be the problem is in the attached file, but......
0
Using Delphi, I have a client / server application which requires an Indy (from 2016) based connection. The problem scenario is very specific. During a data transfer from the Server, the Server disconnects. Indy recognizes this and Raises an Exception (usually 10054) but can fall in to an infinite loop, where it just continues to raise the same Exception over and over again. This exception is only seen in Debug mode, so just appears as an infinite loop to a client. I have a Try / Except block surrounding the test operation in an attempt to catch the Exception but it never exits.
0
How to creat Proxy  with delphi   and how to get all url in memo with name application
0
hi,
Is it possible, in Embarcadero delphi, to be connected to a WEB-Services SOAP (imported with WSDL-Import and with THTTPRIO component ) with a https connection and where the WebServices need a Certificate? How set the certificate?
I need an example.
Thanks,
0
Hi all,

I am trying to create a very simple thread . I want to create a file if it does not exists . And only one thread may run at a time , even if I have 5 threads waiting .

unit FilemuxThread;

interface

uses System.Classes, System.SysUtils, Winapi.Messages, VCL.Forms, Winapi.Windows;

type
  TFilemuxThread = Class(TThread)
  Public
    constructor Create(Rack: String; Glas: String; EsBC : string; XLR_Node : string);
  protected
    tRack: string;
    tGlas: string;
    tEsBC: string;
    tXLR_Node: string;

    procedure Execute; override;
  end;

var isDone : boolean;

implementation

uses inifunctions, DateUtils, MainForm;

constructor TFilemuxThread.Create(Rack: String; Glas: String; EsBC : string; XLR_Node : string);
begin
  inherited Create(False);

  FreeOnTerminate:=True;
  tRack:=Rack;
  tGlas:=Glas;
  tEsBC:=EsBC;
  tXLR_Node:=XLR_Node;


  PostMessage( Main.Handle, TH_MESSAGE, 10, 1);

end;

procedure TFilemuxThread.Execute;
var mypath : string;
    mytimestamp : TDateTime;
    myFile : TextFile;
begin
  inherited;

  try
    while isDone = false do
      begin
        if fileexists(ExtractFilePath(Application.ExeName)+'\Temp\Line5.dat') = false then
          begin
            mypath := iniread('setup.conf','options','file');
            mytimestamp:=date+time;
            AssignFile(myFile, ExtractFilePath(Application.ExeName)+'\Temp\Line5.dat');
            ReWrite(myFile);

            

Open in new window

0
I have Delphi XE8 and I am trying to view large text files. In Delphi 7, there was a component called, I believe TFileView, which performed such a function.

Are there any suggestions as to how to view large text files and mark "found" (SelStart, SelSelLength) words in a different colour?

I tried using TRichEdit, but it is extremely slow.

Thank you. :-)
0
In a TEdit field, when the user changes it, I want the Onchange Event to modify the content of the Text and place the cursor at the end of it.
0
Hello, I want to color every cell of a stringgrid without using the OnCellDraw event in a button for example is there a solution for that? I m using Delphi 7 and sorry for my bad english  Thanks.
0
I'm using Delphi 2010. When using FindFirst, FindNext I am aware that TSearchRec gives useful information such as: Name, Size, Date-Time, Attributes from a file.
My question is: How can I obtain the Size and Date/Time information of an archive when using TDirectory from IOUtils? For example, something as simple as this:

var
   lFiles:TStringDynArray;
   sPath:String;
   lAttributes:TFileAttributes;
   nSize: Int64;
   dFileDate: TDateTime;

begin

   lFiles := TDirectory.GetFiles( 'c:\temp\', '*.*', TSearchOption.soAllDirectories );

   // sPath contains the File Name and the complete path
   sPath := lFiles[0];

   If TFile.Exists( sPath ) then begin

      // TFile Attributes
      lAttributes := TFile.GetAttributes( sPath );

      If ( TFileAttribute.faArchive in lAttributes ) then begin

         // Now retrieve the File Size
         nSize := ???

         // Now retrieve the File Date/Time
         dFileDate := ???

     end;
   end;
end;

Open in new window

0
Hello,

I need to recognize special pictures in my app and depending what picture it recognized I need to start different outcomes.
Is there a method or component to use the phone's camera for reading a picture and then recognize it?

(it needs to run for both Android and iPhone).

Thank you
0
Hi !
I have downloaded VLC mediaplayers Paslibvlc.
It works but I can´t find how to rotate a video !
It can be done on the downloaded  app for windows !
(I  suppose it are compiled in C, C++ !)
I have search on web for more pas-rutines  but can´t find anything.

(It dosen´t care what mediaplayer I use but it must be in pasfiles and
 be able to rotate videos but couse I am pensioner I haven´t much money)

I use Delphi XE7 and have Windows 10.
Ilkka
0
Have the following java code:
// Set your API key: remember to change this to your live API key in production
    String apiKeyUserName = "your api username";
    String apiKeyPassword = "your api password";

    // Set the query params
    DefaultHttpClient httpclient = new DefaultHttpClient();

    List<NameValuePair> params = new ArrayList<NameValuePair>();
    params.add(new BasicNameValuePair("fromPostcode", "2000"));
    params.add(new BasicNameValuePair("toPostcode", "3000"));
    params.add(new BasicNameValuePair("networkId", "01"));
    params.add(new BasicNameValuePair("lodgementDate", "2013-08-01"));
    String query = URLEncodedUtils.format(params, "UTF-8");

    String urlPrefix = "api.auspost.com.au";
    String validateURL = "https://" + urlPrefix + "/DeliveryDates.xml?";

    HttpGet httpGet = new HttpGet(validateURL + query);
    httpGet.addHeader("Cookie", "OBBasicAuth=fromDialog");
    httpGet.addHeader(BasicScheme.authenticate(
        new UsernamePasswordCredentials(apiKeyUserName, apiKeyPassword),
        "US-ASCII",false));

HttpResponse response = httpclient.execute(httpGet);

Open in new window


Want to translate this into an Delphi. For the request I used TIdHttp as below:

procedure RequestDeliveryDate;
var
  IdHTTP: TIdHTTP;
  LHandler: TIdSSLIOHandlerSocketOpenSSL;
  lResponse: String;
  requestURL: String;
begin
  IdHTTP := TIdHTTP.Create();
  IdHTTP.Request.BasicAuthentication := True;
  IdHTTP.Request.Username := 'your api username';
  IdHTTP.Request.Password := 'your api password';
  IdHTTP.Request.CharSet := 'utf-8';

  LHandler := TIdSSLIOHandlerSocketOpenSSL.Create();
  IdHTTP.IOHandler := LHandler;

  requestURL := 'https://api.auspost.com.au/DeliveryDates.xml?fromPostcode=2000' +
                                                            '&toPostcode=3000' +
                                                            '&networkId=01' +
                                                            '&lodgementDate=2018-02-23' +
                                                            '&numberOfDates=01';
  screen.Cursor := crHourGlass;
  try
    lResponse := IdHTTP.Get(requestURL);
    screen.Cursor := crDefault;
  except
    on E: Exception do
    begin
      screen.Cursor := crDefault;
      ShowMessage(E.Message);
    end;
  end;
  IdHTTP.Free;
end;

Open in new window


Let's presume that I do supply the right api user name and password. When I call the above code I get the following error: "This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required."

What I'm doing wrong? Any suggestion?

Note: I see that I'm missing the Cookie but I have no idea how to add it ...
0
Hello,

I have Assertion failure error message in my Delphi Fmx application in the following cases:

1.

In the AfterInsert event, but only if the dataset is completely empty:

procedure TMainForm.MyQueryAfterInsert(DataSet: TDataSet);
begin
  FieldByName('pha').AsString          := Pha;
End;

2.

When I first click in a cell to edit I keep getting repeatedly Assertion failure error messages.
Then, after a time I can edit it normally.
But if I restart the program it goes again.

Thank you very much!
0
var TimeTableArray : Array [1..28,1..288] of String;

Procedure InitialiseTimeTable;
Var i , j : integer;
Begin
for i := 1 to 28 do
    Begin
    for j := 1 to 288 do
        Begin
        TimeTableArray[i,j] := ' ';
        End;
    End;
End;

Procedure WriteTimeTableDataToFile;
var tdata : textfile;
    i, j : integer;
Begin
for i := 1 to 28 do
    begin
    assignfile(tdata, UserPath + inttostr(i) +'.txt');
    rewrite(tdata);
        for j := 1 to 288 do           //This loop causes the error
            Begin                            //I/O error 105
            writeln(TimeTableArray[i,j]);
            End;
    closefile(tdata);
    end;
End;

It works fine if the loop above only writes ' '
0
Hello,

In Delphi VCL if I use this code:

MyProcedure1;
MyProcedure2;
MyProcedure3;

... then it will execute one after another: first MyProcedure1 then MyProcedure2  etc.


However if I use FMX application, all 3 procedures execute at once.
How can I modify it so as it would behave just like in VCL?

Thank you very much!
0

Delphi

59K

Solutions

17K

Contributors

Delphi is the most powerful Object Pascal IDE and component library for cross-platform Native App Development with flexible Cloud services and broad IoT connectivity. It provides powerful VCL controls for Windows 10 and enables FMX development for Windows, Mac and Mobile. Delphi is your choice for ultrafast Enterprise Strong Development™. Look for increased memory for large projects, extended multi-monitor support, improved Object Inspector and much more. Delphi is 5x faster for development and deployment across multiple desktop, mobile, cloud and database platforms including 32-bit and 64-bit Windows 10.

Top Experts In
Delphi
<
Monthly
>