development-point

development-point (https://vb.development-point.com/index.php)
-   الأرشيف (https://vb.development-point.com/forumdisplay.php?f=80)
-   -   الدرس الثالث المصفوفات .. المصفوفات الثابتة .. StaticArray (https://vb.development-point.com/showthread.php?t=1769)

‏windows 8 11-03-2012 05:15 PM

الدرس الثالث المصفوفات .. المصفوفات الثابتة .. StaticArray
 


درسنا اليوم عن شرح استخدام المصفوفات :

يوجد لدينا نوعين من المصفوفات :


مصفوفة متحركة

ومصفوفة ثابتة

نبدأ اليوم بالمصفوفة الثابتة


StaticArray


سوف نبدأ بمثال ونشرحه ..
:




اقتباس:
var ArrayTest : Array[0..5] of string

http://im18.gulfup.com/xHnD2.png


نشرح :


var : متغيير

ArrayTest : اسم المصفوفة
0..5 طول المصفوفة
من الصفر الى الخمس يعني 6
المصفوفة هي حرفية of string

مثال حي عن استخراج محتويات مصفوفة الى

memo1

http://im18.gulfup.com/xHnD2.png


اقتباس:

var ArrayTest : array[0..5] of string;
i : integer;
begin
for i := 1 to length(ArrayTest) -1 do
begin
ArrayTest[i] := ('Test' + intToStr(i));
mmo1.lines.add(ArrayTest[i]);
end;
end;

الناتج :


http://205.196.123.177/086l6g7cbnfg/...Untitleddd.gif

الى هنا يكون درسنا قد انتهى .. انتظروني في دروس اخرى ..






الساعة الآن 10:41 PM

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
development-point

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47