Rabu, November 22, 2017

Using Lazarus For Pascal Programming

How to use lazarus software as pascal programming:
  1. Open lazarus software
  2. On menu, choose File => Project => Program => OK
  3. Body of program is located between begin and end.
    program Project1;

    {$mode objfpc}{$H+}

    uses
    {$IFDEF UNIX}{$IFDEF UseCThreads}
    cthreads,
    {$ENDIF}{$ENDIF}
    Classes
    { you can add units after this };

    begin
    end.

    Example:
    program Project1;

    {$mode objfpc}{$H+}

    uses
    {$IFDEF UNIX}{$IFDEF UseCThreads}
    cthreads,
    {$ENDIF}{$ENDIF}
    Classes
    { you can add units after this };

    begin
    writeln('Assalamu ',#39,'alaikum');
    readln
    end.

  4. Variable is located above of begin
    program Project1;

    {$mode objfpc}{$H+}

    uses
    {$IFDEF UNIX}{$IFDEF UseCThreads}
    cthreads,
    {$ENDIF}{$ENDIF}
    Classes
    { you can add units after this };

    Var
    a,b:integer;

    begin
    writeln('Assalamu ',#39,'alaikum');

    write('input a number! '); readln(a);
    write('input a number again! '); readln(b);
    writeln(a,' + ',b,' = ',a+b);
    readln
    end.

  5. To check syntx/script, on menu, choose Run => Compile, to show the result: Run => Run


That is how to use lazarus software as pascal programming, hopefully useful

1 komentar:

Kunjungi juga
www.menarikeuy.com