Forum > Arabic

شاركـ ببرنامج

<< < (5/5)

Al-Eid:
السلام عليكم
هذا برنامج لترتيب مصفوفة

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} --- program forloop;uses crt;var a:array[1..10]of byte;   temp:byte;   i,k:byte;begin    clrscr;    (*fill the array with random numbers*)    WriteLn('fill the array with random numbers : '); for i:=1 to 10 dobegin     ReadLn(a[i]);    //random(100)+1 end;    (*short the numbers of the array a*)  for i:=1 to 9 dobegin       for k:=i+1 to 10 do begin          if a[i] > a[k] thenbegin             temp:=a[i];               a[i]:=a[k];               a[k]:=temp;          end;        end;end;   writeln;     writeln('shorted results: '); (*write the result to the screen*)  for i:=1 to 10 do begin       write(a[i],','); end;  writeln;    (*press any key to quit*)    while not keypressed do continue;end.(*created by FlamingClaw 2010.02.04.*)   

pascal111:

--- Quote from: Al-Eid on October 27, 2021, 03:11:34 pm ---السلام عليكم
في الحقيقة هذا ليس برنامج ولكنه عبارة عن كود صغير وجدته في الأنترنت وأردت أن أنشره في هذا الموضوع
يعمل هذا الكود مع أداة  DBNavigator بحيث يقوم بسؤال المستخدم على تأكيد عملية الحذف
أولا نجعل قيمة الخاصية  ConfirmDelete تساوي False للأداة DBNavigator

وفي الحدث BeforeDelete للأداة SQLQuery نكتب الكود التالي

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---   if MessageDlg('تحذير','هل أنت متأكد من حذف',mtWarning,mbYesNo,0)<> mrYes  then Abort   else if MessageDlg('تأكيد','للتأكيد مرة ثانية'+#13+'هل أنت متأكد من حذف',mtWarning,mbYesNo,0)<> mrYes then Abort ; 
--- End quote ---
إستخدام جيّد جدّاً لأساليب البرمجة المرئيّه ،أتكلّم من واقع خبرتي مع البرمجة في بيئة الـ DOS

pascal111:

--- Quote from: Al-Eid on November 24, 2021, 12:01:46 pm ---السلام عليكم
هذا برنامج لترتيب مصفوفة

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} --- program forloop;uses crt;var a:array[1..10]of byte;   temp:byte;   i,k:byte;begin    clrscr;    (*fill the array with random numbers*)    WriteLn('fill the array with random numbers : '); for i:=1 to 10 dobegin     ReadLn(a[i]);    //random(100)+1 end;    (*short the numbers of the array a*)  for i:=1 to 9 dobegin       for k:=i+1 to 10 do begin          if a[i] > a[k] thenbegin             temp:=a[i];               a[i]:=a[k];               a[k]:=temp;          end;        end;end;   writeln;     writeln('shorted results: '); (*write the result to the screen*)  for i:=1 to 10 do begin       write(a[i],','); end;  writeln;    (*press any key to quit*)    while not keypressed do continue;end.(*created by FlamingClaw 2010.02.04.*)   
--- End quote ---

منطق ممتاز!

kito:

--- Quote from: pascal111 on September 03, 2021, 08:50:58 pm ---هذا برنامج بسيط كنموذج لعمل برمجة مرئيّة دون حد النموذج.


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---program project1; {$mode objfpc}{$H+} uses  interfaces,  {$IFDEF UNIX}{$IFDEF UseCThreads}  cthreads,  {$ENDIF}{$ENDIF}  Classes, Dialogs, sysutils  { you can add units after this }; var   x:real;  y:string;  err:integer; begin    repeat  y:=inputbox('Enter...','Enter correct numeric value:','');  val(y,x,err);  until (y<>'') and (err=0);   showmessage(floattostr(x)); end.  
--- End quote ---

حاولت تجربة هذا المثال  لكن دائما تأتيني رسالة الخطأ المرفقة نفس رسالة الخطأ عند تنزيل الملف المرفق و تشغيله
_________________________
lazarus 2.2.4
win 11 64 bit



Navigation

[0] Message Index

[*] Previous page

Go to full version