Difference between revisions of "FCL/id"

From Lazarus wiki
Jump to navigationJump to search
(New page: {{FCL}} ''Free Component Library'' (FCL) teridiri dari kumpulan unit yang menyediakan komponen (umumnya kelas) untuk tugas-tugas umum. Dimaksudkan agar kompatibel dengan Delphi's ''Visual...)
 
Line 14: Line 14:
 
=== Pemakaian ===
 
=== Pemakaian ===
  
To use an FCL component you need to include its name in a '''uses''' clause of your program or unit (see example below).
+
Untuk menggunakan komponen FCL Anda perlu menyertakan nama dalam klausul '''uses''' pada program atau unit ANda (lihat contoh di bawah).
The default compiler configuration is set up to search the fcl directory for such units.
+
Konfigurasi kompilator standar disiapkan untuk mencari direktori fcl terhadap unit tersebut.
You can also set the appropriate search path with a command-line compiler option of the form -Fu<path-to-fcl-units>.
+
Anda juga dapat menetapkan path pencarian dengan opsi kompilator baris perintah dalam bentuk -Fu<path-to-fcl-units>.
  
 
=== Dokumentasi ===
 
=== Dokumentasi ===

Revision as of 19:41, 3 February 2008

Deutsch (de) English (en) español (es) suomi (fi) français (fr) Bahasa Indonesia (id) 日本語 (ja) русский (ru) 中文(中国大陆)‎ (zh_CN)

Free Component Library (FCL) teridiri dari kumpulan unit yang menyediakan komponen (umumnya kelas) untuk tugas-tugas umum. Dimaksudkan agar kompatibel dengan Delphi's Visual Component Library (VCL), tetapi FCL terbatas hanya komponen non-visual. Di lain pihak, FCL melebihi VCL.

Lihat Free Component Library untuk status pengembangan saat ini dan tinjauan atas komponen yang tersedia (meskipun ini tidak konsisten dengan Reference for 'fcl' Lazarus). Anda juga dapat memeriksa repositori sumber. Catatan bahwa ada juga beberapa file spesifik-platform dalam FCL.

Setelah contoh, Anda dapat menemukan daftar beberapa komponen FCL.

Pemakaian

Untuk menggunakan komponen FCL Anda perlu menyertakan nama dalam klausul uses pada program atau unit ANda (lihat contoh di bawah). Konfigurasi kompilator standar disiapkan untuk mencari direktori fcl terhadap unit tersebut. Anda juga dapat menetapkan path pencarian dengan opsi kompilator baris perintah dalam bentuk -Fu<path-to-fcl-units>.

Dokumentasi

Currently, the FCL is not documented (feel free to contribute; also take a look at Reference for 'fcl'). For Delphi compatible units, you could consult the Delphi documentation. You can always take a look at the source files in the source repository.

Contoh

The following program illustrates the use of the class TObjectList in the FCL unit Contnrs (providing various containers, including lists, stacks, and queues):

<delphi> program TObjectListExample;

uses
  Classes, { from RTL for TObject }
  Contnrs; { from FCL for TObjectList }

type
   TMyObject = class(TObject)  { just some application-specific class }
   private
     FName: String; { with a string field }
   public
     constructor Create(AName: String); { and a constructor to create it with a given name }
     property Name: String read FName; { and a property to read the name }
  end;

constructor TMyObject.Create(AName: String);
begin
  inherited Create;
  FName := AName;
end;

var
  VObjectList: TObjectList; { for a list of objects; it is a reference to such a list! }

begin
  VObjectList := TObjectList.Create  { create an empty list }
  with VObjectList do
  begin
    Add(TMyObject.Create('Thing One'));
    Writeln((Last as TMyObject).Name);
    Add(TMyObject.Create('Thing Two'));
    Writeln((Last as TMyObject).Name);
  end;
end.</delphi>

This program must be compiled in an object-oriented mode, such as -Mobjfpc or -Mdelphi.

Komponen FCL

This is not an exhaustive list (to avoid duplication of effort). It only mentions some important components, or components that are otherwise not easy to find.

Classes
Base classes for Object Pascal extensions in Delphi mode
Contnrs
Some common container classes
FPCUnit
Unit testing framework (based on Kent Beck's unit testing framework, e.g. cf. JUnit), documenting article about FPCUnit
XMLRead, XMLWrite and DOM
Detailed at the XML Tutorial