أبدأ مع لغة الباسكال ObjectPascal

1- إظهار نص على إطار MSDOS
الكود التالي يرينا كيف نكتب نص على الشاشة السوداء Console

program HelloConsole;
{$APPTYPE CONSOLE} var strMessage: string; begin strMessage := 'Hello, World'; writeln (strMessage); // wait until the Enter key is pressed readln; end.

إظهار نص على مختلف الأنظمة :IOS -  ANDROID و MSWINDOWS

unit HelloPlatformForm; interface uses System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.StdCtrls, FMX.Controls.Presentation; type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.fmx} procedure TForm1.Button1Click(Sender: TObject); begin {$IFDEF IOS} ShowMessage ('Running on iOS'); {$ENDIF} {$IFDEF ANDROID} ShowMessage ('Running on Android'); {$ENDIF} {$IFDEF MSWINDOWS} ShowMessage ('Running on Windows'); {$ENDIF} end; end.
3- بعض التصريحات والمتغيرات : 

unit IdentifiersTestForm; interface uses System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs; type TForm1 = class(TForm) private { Private declarations } public { Public declarations } end; var Form1: TForm1; // classic identifiers MyValue: Integer; Value1: Integer; My_Value: Integer; _Value: Integer; Val123: Integer; _123: Integer; Cantu: Integer; // valid unicode identifiers Cantù: Integer; : Integer; 画像: Integer; : Integer; ⒈5: Integer; // invalid identifiers // 123: Integer; // 1Value: Integer; // My Value: Integer; // My-Value: Integer; // My%Value: Integer; implementation {$R *.fmx} end.


المشاركات الشائعة