28 thoughts on “About

  1. hi dear

    thank you for your useful blog,
    i am newbie in Lazarus programming and have good working experience in Delphi programming, i am going to switch to Lazarus and MySQL database and have a few question.

    witch is better for database?(MySQL-FireBird)

    how can i create 64 bit binary project with Lazarus?

    i think if you post a tutorial about connecting Lazarus to MySQL will cause have better blog.
    i recently post a question in this URL and i am confused!!

    http://www.lazarus.freepascal.org/index.php/topic,19010.0.html

    help me.

    thank you.

  2. MySQL versions needs different libraries in Lazarus, and needs additional third party package to deal with in Lazarus, but in FireBird native Lazarus components can work just fine with all available versions of FireBird

  3. Yes, it is more lighter than MySQL, but more robust, more stable and easy to install. I’ve used it for about 10 years since it was Interbase, without any crash.

    If you like MySQL and you have success with it using Lazarus why not to talk about it in a blog, a lot of people are using MySQL.

  4. sorry, I forget to talk about 64 bit.
    Actually I have no experience about cross-compliation in Lazarus, which means producing 64 bit binaries from 32 bit system and vice versa, and producing executables for other platforms from one platform. May be you should use Code Typhon for cross-compliation: http://www.pilotlogic.com/sitejoom/index.php/codetyphon

    I have a 64 bit Linux installed in external hard disk, and I have 64 bit Lazarus version on that hard disk, I used it to produce 64 bit versions of my Lazarus applications. My primary development machine contains 32 bit of Linux.

  5. As I said before, I have two versions of Lazarus installed, 32 bit version in 32 bit Ubuntu, and another one 64 bit in 64 bit Linux mint in external Hard disk.

    For TProcess, see Options/poUsePipes

  6. hi أبو إياس

    thank you for your previous post,because I am not sure that Google translator have exact translation I’m going to that introduce your Arabic article to my Khuzestan Arabian friends.
    so I have win 64 bit and installed Lazarus 32 bit,my application could ran in 32-64 bit machine?

    thank you

  7. hi Motaz Abdel Azeem
    Nice to Meet You and very happy for find your blog and lazarus codes Interestingly
    I am from Iran and i can speak english a little 🙂 .
    I’ve been programming with Delphi 7 and Microsoft Sql Server 2000 in the past.
    I migrated to GNU/Linux a few years ago and used Ubuntu/Kubuntu and Lazarus 1.04 and Mysql for developing database application in my project .
    http://forum.ubuntu.ir/index.php/topic,35247.0.html
    this topic i trying learn to my Friends use lazarus and working with database.
    Recently i trying create a Download manager ( for GNU/Linux and Windows).
    i use synapse and your code in blog Helped me so much and Thank you very much.
    but in your code this topic :
    https://freepascalanswers.wordpress.com/2012/06/15/synapas-http-thread
    in my system not worked and application not running .
    Can you please help me؟

  8. hi Motaz again 🙂
    in start i trying create a simple Downloader from web server.
    i get file Successfully from INTERNET in the first step.
    one problem :
    when downloading a file my application locked and when download finished my application is free.
    According to your post for use thread I understand that should use thread in my project.
    when i running my program exit very fast or nix run.(Of course when i remove line {$IFDEF UNIX}
    cthreads, cmem,
    {$ENDIF}
    my project running but not work completely.
    my code :
    unit Unit1;

    {$mode objfpc}{$H+}

    interface

    uses
    {$IFDEF UNIX}
    cthreads, cmem,
    {$ENDIF}
    Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Buttons,
    StdCtrls,httpsend,LCLProc, ExtCtrls, ComCtrls,blcksock,typinfo;

    type
    { THTTPDownload }
    THTTPDownload = class(TThread)
    private
    fURL: string;
    fFileName: string;
    public
    constructor Create(URL, FileName: string);
    procedure Execute; override;
    end;

    { TForm1 }
    TForm1 = class(TForm)
    Button1: TButton;
    Edit1: TEdit;
    Edit2: TEdit;
    Edit3: TEdit;
    Edit4: TEdit;
    Edit5: TEdit;
    Label1: TLabel;
    Label10: TLabel;
    Label11: TLabel;
    Label12: TLabel;
    Label13: TLabel;
    Label14: TLabel;
    Label15: TLabel;
    Label16: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    Label8: TLabel;
    Label9: TLabel;
    Memo1: TMemo;
    ProgressBar1: TProgressBar;
    Timer1: TTimer;
    procedure Button1Click(Sender: TObject);
    procedure OnStatus(Sender: TObject;Reason:THookSocketReason;const Value:string);
    procedure DownloadTerminiated(Sender: TObject);
    private
    http:THTTPSend;
    testaddr:string;
    TotalBytes,CurrentBytes:Integer;
    { private declarations }
    public
    { public declarations }
    end;

    var
    Form1: TForm1;

    implementation

    { THTTPDownload }
    constructor THTTPDownload.Create(URL, FileName: string);
    begin
    inherited Create(True);
    fURL:= URL;
    fFileName:= FileName;
    end;
    procedure THTTPDownload.Execute;
    var httpClient: THTTPSend;
    begin
    httpClient:= THTTPSend.Create;
    if httpClient.HTTPMethod(‘GET’, fURL) then
    httpClient.Document.SaveToFile(fFileName);
    Form1.Memo1.Lines.Add(fFileName + ‘, has been downloaded’);

    httpClient.Free;
    end;

    {$R *.lfm}

    { TForm1 }

    procedure TForm1.Button1Click(Sender: TObject);
    var
    httpClient: THTTPSend;
    download: THTTPDownload;
    begin
    ProgressBar1.Position:=0;
    CurrentBytes:=0;
    TotalBytes:=0;
    Button1.Enabled:=False;
    download:= THTTPDownload.Create(Edit1.Text,’download.jpg’);
    download.OnTerminate:= @DownloadTerminiated;
    httpClient.Sock.OnStatus:=@OnStatus;
    download.Resume;
    memo1.Lines.Append(‘Download started’);
    end;

    procedure TForm1.OnStatus(Sender: TObject;Reason:THookSocketReason;const Value: string);
    begin
    if (Reason=HR_ReadCount) then
    begin
    CurrentBytes:=strtoint(Value)+CurrentBytes;
    Label10.Caption:=inttostr(CurrentBytes);
    Memo1.Lines.Append(inttostr(http.DownloadSize));
    ProgressBar1.Position:=round(100*(CurrentBytes / TotalBytes));
    end;
    Memo1.Lines.Append(getEnumName(typeinfo(THookSocketReason), integer(Reason)) + ‘ ‘ + Value);
    Form1.Update;
    end;

    procedure TForm1.DownloadTerminiated(Sender: TObject);
    begin
    Memo1.Lines.Append(‘Thread finished’);
    Button1.Enabled:=True;
    end;

    end.

  9. You are right my friend. i understand Quran and Ahadeeth partly and Most of our religious books Including Arabic And Persian But overall You are right and should my Arabic better than English.

  10. Hi Motaz Abdel Azeem,
    Thank you for writing Start Programming using Object Pascal.
    I’m new into programming and this book is helping me a lot
    with exploring Pascal.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s