مشكله اضافه الادوات داخل function
#1
Photo 
 

السلام عليكم 
 
اخواني لدي مشكله اضافه الادوات داخل 
function
وهذه صوره توضح المشكله

[صورة: p_114090ruk1.png]

وشكراا لكم احبتي
الرد
#2
(14-02-2019, 07:39 PM)عبد الله اكرم كتب :
السلام عليكم 
 

و عليكم السلام و رحمة الله تعالى و بركاته
لا يمكن استعمال المكونات داخل ال Functions
اظن انك تقصد هذا :

كود :
Function MaxValue(a,b : Integer):Integer; begin    if a > b then    result := a    else    result := b; end; procedure TForm1.Button1Click(Sender: TObject); begin edit1.text := 'Hello'  + ' ' + IntToStr(MaxValue(7,11));  // call function end; end.
[-] كل من 1 user says قال شكرا ل Rever7eR على المشاركة المفيدة
  • عبد الله اكرم
الرد
#3
وعليكم السلام


إما أن تضيف الإجراء ضمن class الخاص بالفورم أو تقوم بالاستدعاء عبر كامل الطرف الأبوي

PHP كود :
type
  TForm1 
= class(TForm)
  
   
private
    { Private declarations }

  public
    { Public declarations }
    function MaxValue(a, b: integer): integer;
  end;
  
  
function TForm1.MaxValue(a, b: integer): integer;
begin
    if a 
> b then
        result 
:= a
    else
        result 
:= b;
    Edit1.text := 'Hello';
end; 



أو

PHP كود :
function MaxValue(a, b: integer): integer;
begin
    if a 
> b then
        result 
:= a
    else
        result 
:= b;
    Form1.Edit1.text := 'Hello';
end; 
[-] كل من 2 users say قال شكرا ل merouane على المشاركة المفيدة
  • Rever7eR, عبد الله اكرم
الرد
#4
(14-02-2019, 08:19 PM)merouane كتب : وعليكم السلام


إما أن تضيف الإجراء ضمن class الخاص بالفورم أو تقوم بالاستدعاء عبر كامل الطرف الأبوي

PHP كود :
type
  TForm1 
= class(TForm)
  
   
private
    { Private declarations }

  public
    { Public declarations }
    function MaxValue(a, b: integer): integer;
  end;
  
  
function TForm1.MaxValue(a, b: integer): integer;
begin
    if a 
> b then
        result 
:= a
    else
        result 
:= b;
    Edit1.text := 'Hello';
end; 



أو

PHP كود :
function MaxValue(a, b: integer): integer;
begin
    if a 
> b then
        result 
:= a
    else
        result 
:= b;
    Form1.Edit1.text := 'Hello';
end; 

شكرااا اخي هذا هوه المطلوب Smile
الرد


التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم