FCL/id: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: FCL/id
| Old | New | Line | |
|---|---|---|---|
| 1 | + | *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. | |
| 2 | + | ||
| 3 | + | Lihat [Free Component Library](http://www.freepascal.org/fcl/fcl.html) untuk status pengembangan saat ini dan tinjauan atas komponen yang tersedia (meskipun ini tidak konsisten dengan [Reference for 'fcl'](http://lazarus-ccr.sourceforge.net/docs/fcl/index.html) Lazarus). Anda juga dapat memeriksa [repositori sumber](http://www.freepascal.org/cgi-bin/viewcvs.cgi/trunk/packages/). Catatan bahwa ada juga beberapa file spesifik-platform dalam FCL. | |
| 4 | + | ||
| 5 | + | Setelah contoh, Anda dapat menemukan daftar beberapa komponen FCL. | |
| 6 | + | ||
| 7 | + | ### Pemakaian | |
| 8 | + | ||
| 9 | + | 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\>. | |
| 10 | + | ||
| 11 | + | ### Dokumentasi | |
| 12 | + | ||
| 13 | + | Saat ini, FCL tidak didokumentasikan (Anda bebas untuk berkontribusi; juga lihat di [Referensi untuk 'fcl'](http://lazarus-ccr.sourceforge.net/docs/fcl/index.html)). Untuk unit kompatibel Delphi, Anda dapat merujuk ke dokumentasi Delphi. Anda selalu dapat melihat kode file sumber di [repositori sumber](http://www.freepascal.org/cgi-bin/viewcvs.cgi/trunk/packages/). | |
| 14 | + | ||
| 15 | + | ### Contoh | |
| 16 | + | ||
| 17 | + | Program berikut mengilustrasikan penggunaan kelas TObjectList dalam FCL unit Contnrs (menyediakan berbagai container, termasuk list, stack, dan queue): | |
| 18 | + | ||
| 19 | + | ``` pascal | |
| 20 | + | program TObjectListExample; | |
| 21 | + | ||
| 22 | + | uses | |
| 23 | + | Classes, { from RTL for TObject } | |
| 24 | + | Contnrs; { from FCL for TObjectList } | |
| 25 | + | ||
| 26 | + | type | |
| 27 | + | TMyObject = class(TObject) { just some application-specific class } | |
| 28 | + | private | |
| 29 | + | FName: String; { with a string field } | |
| 30 | + | public | |
| 31 | + | constructor Create(AName: String); { and a constructor to create it with a given name } | |
| 32 | + | property Name: String read FName; { and a property to read the name } | |
| 33 | + | end; | |
| 34 | + | ||
| 35 | + | constructor TMyObject.Create(AName: String); | |
| 36 | + | begin | |
| 37 | + | inherited Create; | |
| 38 | + | FName := AName; | |
| 39 | + | end; | |
| 40 | + | ||
| 41 | + | var | |
| 42 | + | VObjectList: TObjectList; { for a list of objects; it is a reference to such a list! } | |
| 43 | + | ||
| 44 | + | begin | |
| 45 | + | VObjectList := TObjectList.Create { create an empty list } | |
| 46 | + | with VObjectList do | |
| 47 | + | begin | |
| 48 | + | Add(TMyObject.Create('Thing One')); | |
| 49 | + | Writeln((Last as TMyObject).Name); | |
| 50 | + | Add(TMyObject.Create('Thing Two')); | |
| 51 | + | Writeln((Last as TMyObject).Name); | |
| 52 | + | end; | |
| 53 | + | end. | |
| 54 | + | ``` | |
| 55 | + | ||
| 56 | + | Program ini harus dikompilasi dalam mode orientasi-obyek, seperti -Mobjfpc atau -Mdelphi. | |
| 57 | + | ||
| 58 | + | ### Komponen FCL | |
| 59 | + | ||
| 60 | + | Ini bukan daftar keseluruhan (guna menghindari duplikasi usaha). Ini hanya menyebutkan beberapa komponen penting, atau komponen yang sebaliknya tidak mudah untuk ditemukan. | |
| 61 | + | ||
| 62 | + | Classes | |
| 63 | + | Basis kelas untuk ekstensi Object Pascal dalam mode Delphi | |
| 64 | + | ||
| 65 | + | Contnrs | |
| 66 | + | Beberapa kelas kontainer umum | |
| 67 | + | ||
| 68 | + | FPCUnit | |
| 69 | + | Kerangka pengujian unit (didasarkan pada kerangka kerja pengujian unit Kent Beck, misalnya. cf. [JUnit](http://www.junit.org/)), [mendokumentasi artikel mengenai FPCUnit](http://www.freepascal.org/docs-html/fpcunit.pdf) | |
| 70 | + | ||
| 71 | + | XMLRead, XMLWrite and DOM | |
| 72 | + | Rinciannya di [[XML Tutorial/id|Tutorial XML]] | |
| 73 | + | ||
| 74 | + | --- | |
| 75 | + | *From the Free Pascal wiki, page "FCL/id", as it stood on 2020-02-14 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* |
