Lazarus

Free Pascal => Beginners => Topic started by: pascal111 on May 14, 2021, 08:11:38 pm

Title: Message methods [SOLVED]
Post by: pascal111 on May 14, 2021, 08:11:38 pm
كُنتُ أقرأ في وثائق الـ free Pascal وصادفتني الـ Message methods كما في هذا الرابط الرسمي https://www.freepascal.org/docs-html/current/ref/refsu31.html#x83-1050006.6.7 (https://www.freepascal.org/docs-html/current/ref/refsu31.html#x83-1050006.6.7) غير أنّي لم أستوعب الفكرة ولم أعرف فائدة أو جدوى الـ Message methods ولماذا تمّت إضافتها للأصناف فعلى ما أتذكّر لم يُوجد هذا النّوع من الـ methods في نسخ الـ OOP القياسيّة للغات التي كانت تعمل في النّظام DOS.

google translate:

"I was reading the free Pascal documents and came across the Message methods as well as in this official link https://www.freepascal.org/docs-html/current/ref/refsu31.html#x83-1050006.6.7  (https://www.freepascal.org/docs-html/current/ref/refsu31.html#x83-1050006.6.7) However, I did not understand the idea and did not know the usefulness or usefulness of Message methods and why they were added to classes. As far as I can remember, this type of method was not found in the standard OOP versions of languages ​​that were running in DOS."
Title: Re: Message methods
Post by: MarkMLl on May 14, 2021, 09:03:14 pm
Assuming that we're thinking about the same thing (and if not, I apologise) it's for hanging methods onto externally-generated events:

Code: Pascal  [Select][+][-]
  1. ...
  2.   private
  3.     { Private declarations }
  4.     fastTerminate, trimWorkingSetAsap: BOOLEAN;
  5.     procedure WMQueryEndSession(var Message: TWMQueryEndSession); message WM_QUERYENDSESSION;
  6.     procedure WMSysColorChange(var Message: TWMSysColorChange); message WM_SYSCOLORCHANGE;
  7.   public
  8.     { Public declarations }
  9.   end;
  10.  

MarkMLl
Title: Re: Message methods
Post by: VTwin on May 14, 2021, 09:13:28 pm
You can also add custom messages. For example, I have several applications that draw several plots of data. If the data changes, the data Form sends a message, and the plot Forms update when they receive the message.
Title: Re: Message methods
Post by: pascal111 on May 14, 2021, 11:28:29 pm
يُمكننا أن قرع كأسينا أيها النبيل @MarkMLl نخب هذه المعلومة الرائعة ولكن بذكر مُساعدة النبيل @VTwin فلقد أوضح كلامكـ المُوجز "it's for hanging methods onto externally-generated events" وإنّها لعبارة إنجليزيّة أنيقة وبليغة وقياسيّة وبلغة علميّة للتعبير عن المعنى المنشود (أعذراني فأنا أُحب أسلوب الروايات الإنجليزيّة).

إستفساري التالي هو كيف يكونُ هناكـ مُتغيّر اسمه Message وأنا على ما أظنّ أنّها كلمة من كلمات لغة البرمجة نفسها كما أوردت في الكود الذي زوّدتنا به؟!

google translate:

"We can knock our glasses, noble @MarkMLl, toast "in honor of" this wonderful information, but by mentioning the help of the noble @VTwin, "he made it clear" your brief statement made it clear: "it's for hanging methods onto externally-generated events" and it is an elegant, eloquent, standard English phrase and scientific language to express the desired meaning (excuse me, I love the style English novels).

My next inquiry is: How can there be a variable named Message, and I think it is one of the words of the programming language itself, as it was mentioned in the code that you provided us with ?!"

Code: Pascal  [Select][+][-]
  1.     procedure WMQueryEndSession(var Message: TWMQueryEndSession); message WM_QUERYENDSESSION;
  2.  
Title: Re: Message methods
Post by: VTwin on May 15, 2021, 12:58:52 am
My understanding is that the message methods take untyped parameters, so can refer to any data such as a record. The final "message" indicates an integer (dword) value that identifies the method to be called.

So a message call includes an identifier, along with data to be used by the receiving method. The identifier tells which method to be called, which then uses the data.
Title: Re: Message methods
Post by: VTwin on May 15, 2021, 01:13:02 am
This is a simple example that I use:

Code: Pascal  [Select][+][-]
  1.  
  2. type
  3.   TVMessage = packed record
  4.     Id    : longint;
  5.     Param : word;
  6.     Flag  : word;
  7.     Text  : shortstring;
  8.   end;
  9.  
  10. ...
  11.  
  12.  
  13. { DispatchMessage
  14.   Dispatches a message to all forms. This adds a message to the message queue,
  15.   which will be processsed by the handler after the current process finishes.
  16.   Define a message id such as:
  17.     LM_Msg = LM_USER + 1;
  18.   where LM_USER is defined in LMessages, and a handler such as:
  19.     procedure OnMessage(var msg: TLMessage); message LM_Msg; }
  20. procedure DispatchMessage(Id: dword; Param, Flag: word; Txt: string);
  21. var
  22.   i: integer;
  23.   f: TForm;
  24.   m: TVMessage;
  25. begin
  26.   m.Id := Id;
  27.   m.Param := Param;
  28.   m.Flag := Flag;
  29.   m.Text := Txt;
  30.   for i := 0 to Screen.FormCount - 1 do begin
  31.     f := Screen.Forms[i];
  32.     if (f <> nil) then
  33.       f.Dispatch(m);
  34.   end;
  35. end;
  36.  

Then a method in a form:

Code: Pascal  [Select][+][-]
  1.     procedure OnDataChange(var Msg: TVMessage); message OM_DataChange;
  2.  
Title: Re: Message methods
Post by: VTwin on May 15, 2021, 01:28:30 am
The dual use of "message" is curious, however according to this, "message" is not actually a "reserved" word, just "dangerous":

http://www.festra.com/eng/ref-reserved.htm
Title: Re: Message methods
Post by: ASerge on May 15, 2021, 08:55:41 am
As far as I can remember, this type of method was not found in the standard OOP versions of languages ​​that were running in DOS."
Yes, message methods were first introduced only in Delphi. As noted in message methods (https://www.freepascal.org/docs-html/current/ref/refsu31.html#x83-1050006.6.7) docs, they are primarily intended to ease programming of callback functions in several GUI toolkits, such as Win32 or GTK.
Every time you declare a method this way:
Code: Pascal  [Select][+][-]
  1. procedure SomeMethod(var R); message NNNN;
the compiler adds an entry with the index NNNN to a separate table of virtual methods (message methods).
In the process of working, a certain class (TForm, TApplication, etc), when processing external messages, uses this mechanism through the method TObject.Dispatch(var R), which scans the class hierarchy through the method table to find a suitable index whose value is the first 32-bit number from the R record (in Delphi (http://docwiki.embarcadero.com/RADStudio/Sydney/en/Methods_%28Delphi%29#Message_Methods) - 16-bit).
Title: Re: Message methods
Post by: MarkMLl on May 15, 2021, 09:10:57 am
"We can knock our glasses, noble @MarkMLl, toast "in honor of" this wonderful information, but by mentioning the help of the noble @VTwin, "he made it clear" your brief statement made it clear: "it's for hanging methods onto externally-generated events" and it is an elegant, eloquent, standard English phrase and scientific language to express the desired meaning (excuse me, I love the style English novels).

My next inquiry is: How can there be a variable named Message, and I think it is one of the words of the programming language itself, as it was mentioned in the code that you provided us with ?!"

Google has a surprisingly florid turn of phrase. As far as your final question goes, it's important to appreciate that when a compiler parses (qv) the syntax (qv) of a language, it's not simply saying "what patterns can I match on this line". Focussing on the current example, it's saying "OK, I've got the arbitrarily-named variables out of the way, so I must be looking at one of function procedure property end (plus visibility keywords etc.).

So it starts parsing a procedure declaration and gets to the ; terminator. It then looks ahead one token and finds message, but the only thing this can be in this context is a number (etc.) which tells it what actually to do with the declaration it's just read.

MarkMLl
Title: Re: Message methods
Post by: pascal111 on May 15, 2021, 05:59:25 pm
As far as I can remember, this type of method was not found in the standard OOP versions of languages ​​that were running in DOS."
Yes, message methods were first introduced only in Delphi. As noted in message methods (https://www.freepascal.org/docs-html/current/ref/refsu31.html#x83-1050006.6.7) docs, they are primarily intended to ease programming of callback functions in several GUI toolkits, such as Win32 or GTK.
Every time you declare a method this way:
Code: Pascal  [Select][+][-]
  1. procedure SomeMethod(var R); message NNNN;
the compiler adds an entry with the index NNNN to a separate table of virtual methods (message methods).
In the process of working, a certain class (TForm, TApplication, etc), when processing external messages, uses this mechanism through the method TObject.Dispatch(var R), which scans the class hierarchy through the method table to find a suitable index whose value is the first 32-bit number from the R record (in Delphi (http://docwiki.embarcadero.com/RADStudio/Sydney/en/Methods_%28Delphi%29#Message_Methods) - 16-bit).

لحظة من فضلكـ فهنا يكمن واحدٌ من أسئلتي ،كُنتُ أتعجب أنّهُ يُمكن تمرير سجل لـ Dispatch وكُنتُ أتساءل كيف سيتم معرفة رقم الرسالة أو الـ ID وهنا أنت قلت أنّهُ يتم البحث في أول 32 بت من السجل أي أنّ - إن كان ما فهمته صحيحاً - Dispatch سيتعرّف على رقم الرسالة من خلال أوّل 32 بت من السجل والتي عادةً هي من النّوع Cardinal ويُسمح كذلكـ بالنّوع الحرفي string مع DispatchStr. هل ما فهمته صحيح؟

google translate:

"A moment please, here lies one of my questions, I was wondering that a record could be passed to Dispatch and I was wondering how the message number or ID would be known, and here you said that the first 32 bits of the record are being searched, meaning that - if what I understood is correct - Dispatch will recognize On the message number through the first 32 bits of the register which is usually of type Cardinal, the literal string type is also allowed with DispatchStr. Is what I understood correct?"
Title: Re: Message methods
Post by: pascal111 on May 15, 2021, 06:07:38 pm
This is a simple example that I use:

Code: Pascal  [Select][+][-]
  1.  
  2. type
  3.   TVMessage = packed record
  4.     Id    : longint;
  5.     Param : word;
  6.     Flag  : word;
  7.     Text  : shortstring;
  8.   end;
  9.  
  10. ...
  11.  
  12.  
  13. { DispatchMessage
  14.   Dispatches a message to all forms. This adds a message to the message queue,
  15.   which will be processsed by the handler after the current process finishes.
  16.   Define a message id such as:
  17.     LM_Msg = LM_USER + 1;
  18.   where LM_USER is defined in LMessages, and a handler such as:
  19.     procedure OnMessage(var msg: TLMessage); message LM_Msg; }
  20. procedure DispatchMessage(Id: dword; Param, Flag: word; Txt: string);
  21. var
  22.   i: integer;
  23.   f: TForm;
  24.   m: TVMessage;
  25. begin
  26.   m.Id := Id;
  27.   m.Param := Param;
  28.   m.Flag := Flag;
  29.   m.Text := Txt;
  30.   for i := 0 to Screen.FormCount - 1 do begin
  31.     f := Screen.Forms[i];
  32.     if (f <> nil) then
  33.       f.Dispatch(m);
  34.   end;
  35. end;
  36.  

Then a method in a form:

Code: Pascal  [Select][+][-]
  1.     procedure OnDataChange(var Msg: TVMessage); message OM_DataChange;
  2.  

هل يجب أن يكون "m.Id" يساوي "OM_DataChange" ليتم إستدعاء "OnDataChange" ؟

google translate:

"Does "m.Id" need to be equal to "OM_DataChange" to call "OnDataChange"?"

Code: Pascal  [Select][+][-]
  1. m.Id:=OM_DataChange;
  2.  
Title: Re: Message methods
Post by: pascal111 on May 15, 2021, 06:20:19 pm
"We can knock our glasses, noble @MarkMLl, toast "in honor of" this wonderful information, but by mentioning the help of the noble @VTwin, "he made it clear" your brief statement made it clear: "it's for hanging methods onto externally-generated events" and it is an elegant, eloquent, standard English phrase and scientific language to express the desired meaning (excuse me, I love the style English novels).

My next inquiry is: How can there be a variable named Message, and I think it is one of the words of the programming language itself, as it was mentioned in the code that you provided us with ?!"

Google has a surprisingly florid turn of phrase. As far as your final question goes, it's important to appreciate that when a compiler parses (qv) the syntax (qv) of a language, it's not simply saying "what patterns can I match on this line". Focussing on the current example, it's saying "OK, I've got the arbitrarily-named variables out of the way, so I must be looking at one of function procedure property end (plus visibility keywords etc.).

So it starts parsing a procedure declaration and gets to the ; terminator. It then looks ahead one token and finds message, but the only thing this can be in this context is a number (etc.) which tells it what actually to do with the declaration it's just read.

MarkMLl

ما فهمتُه أن تسمية المُتغير باسم "message" لا يُشكل مُشكلة لدى الـ Compiler ﻷنّهُ إنّما يبحث عن قيمة صحيحة غالباً وليس المُعرّف ذاته.

google translate:

"What I understood is that naming the variable as "message" is not a problem for the Compiler because it is looking for a correct "an integer" value often and not the identifier itself."
Title: Re: Message methods
Post by: VTwin on May 15, 2021, 08:33:08 pm
google translate:

"Does "m.Id" need to be equal to "OM_DataChange" to call "OnDataChange"?"

Yes.

OM_DataChange is just a number such as LM_USER + 1. For this program I name the message ids and methods using this convention which is helpful for me. The leading "O" designates the application, just my convention. 
Title: Re: Message methods
Post by: pascal111 on May 15, 2021, 09:44:41 pm
google translate:

"Does "m.Id" need to be equal to "OM_DataChange" to call "OnDataChange"?"

Yes.

OM_DataChange is just a number such as LM_USER + 1. For this program I name the message ids and methods using this convention which is helpful for me. The leading "O" designates the application, just my convention.

عظيم!

وكذلكـ لديكـ أُسلوب برمجة جيّد.

أظنّني يُمكنني أنْ أقول تقريباً أنّ هذا الموضوع قد حُل إلّا أنّني أرغب في سماع إضافاتٍ وأقوالٍ أخرى في هذه القضيّة (الموضوع ،فأنا أتخيّل هذه المرّة الموضوع كقضيّة قانونيّة).

google translate:

"Great!

Also, you have a good programming style.

I think I can almost say that this issue "topic" has been resolved, but I would like to hear additional additions and other statements in this case (the topic, I am this time imagining the subject as a "case of law" legal issue)."
Title: Re: Message methods
Post by: ASerge on May 15, 2021, 09:57:08 pm
Dispatch will recognize On the message number through the first 32 bits of the register which is usually of type Cardinal, the literal string type is also allowed with DispatchStr. Is what I understood correct?"
TObject.Dispatch will interpret the structure of the record as if it starts with a 32-bit number. For TObject.DispatchStr - as if there is a ShortString at the beginning.
See objpas.inc:
Code: Pascal  [Select][+][-]
  1. procedure TObject.Dispatch(var message);
  2. ...
  3. begin
  4.   index:=dword(message);
  5. ...
Code: Pascal  [Select][+][-]
  1. procedure TObject.DispatchStr(var message);
  2. ...
  3. begin
  4.   name:=pshortstring(@message)^;
  5. ...
Title: Re: Message methods
Post by: pascal111 on May 15, 2021, 10:17:21 pm
Dispatch will recognize On the message number through the first 32 bits of the register which is usually of type Cardinal, the literal string type is also allowed with DispatchStr. Is what I understood correct?"
TObject.Dispatch will interpret the structure of the record as if it starts with a 32-bit number. For TObject.DispatchStr - as if there is a ShortString at the beginning.
See objpas.inc:
Code: Pascal  [Select][+][-]
  1. procedure TObject.Dispatch(var message);
  2. ...
  3. begin
  4.   index:=dword(message);
  5. ...
Code: Pascal  [Select][+][-]
  1. procedure TObject.DispatchStr(var message);
  2. ...
  3. begin
  4.   name:=pshortstring(@message)^;
  5. ...

لوهلةٍ ظننتُ أنّكـ قد أغفلت جزءاً مُهمّاً من سؤالي ولكن بعد مُضي بعض الوقت والتفكّر فيما جاد به قلمكـ إكتشفتُ أنّكـ أجبت عن سؤالي بالضبط ولكن بطريقةٍ أنيقة وبلغة أكاديميّة وفنيّة تقنيّة.

رائع! لقد تمّ إستخدام تقنيّة الـ typecasting في عمليّة إنتقاء البتّات الأولى من السجل ،عمل فنّي ذكي جدّاً ،إنّ لغة الـ Lazarus free Pascal مُدهشة وذكيّة وفنيّة في أساليبها ،لا يُمكننا في الشرق الأوسط إنشاء لغة مثل هذه ،هذه حقيقة!

google translate:

"For a while, I thought that you had omitted an important part of my question, but after spending some time and thinking about what your pen came up with, I discovered that you answered my question exactly, but in an elegant way and in an academic and technical language.

Fabulous! Typecasting has been used in the process of selecting the first bits from the register "record", a very clever artwork, Lazarus free Pascal is amazing, smart and artistic in its methods, we cannot in the Middle East create a language like this, this is a fact!"
Title: Re: Message methods
Post by: engkin on May 16, 2021, 12:22:20 am
Fabulous! Typecasting has been used in the process of selecting the first bits from the register "record", a very clever artwork, Lazarus free Pascal is amazing, smart and artistic in its methods, we cannot in the Middle East create a language like this, this is a fact!"

Object Pascal is very nice, yes. But nothing unusual in typecasting, as mentioned above, to make a whole region like the Middle East unable to create a language like this. It is nice to compliment people and their work, but not on the expense of other people.

I had seen some members here express their admiration of Object Pascal on the expense of C and C++.


Code: Pascal  [Select][+][-]
  1. var
  2.   //as: integer = 1;
  3.   //in: integer = 2;
  4.   //is: integer = 3;
  5.   //or: integer = 4;
  6.   //and: integer = 5;
  7.   //div: integer = 6;
  8.   //mod: integer = 7;
  9.   //not: integer = 8;
  10.   //shl: integer = 9;
  11.   //shr: integer = 10;
  12.   //xor: integer = 11;
  13.   explicit: integer = 12;
  14.   enumerator: integer = 13;
  15.   initialize: integer = 14;
  16.   finalize: integer = 15;
  17.   addref: integer = 16;
  18.   copy: integer = 17;
  19.   inc: integer = 18;
  20.   dec: integer = 19;
  21.   //end: integer = 20;
  22.   //of: integer = 21;
  23.   //file: integer = 22;
  24.   identifier: integer = 23;
  25.   non: integer = 24;
  26.   //const: integer = 25;
  27.   real: integer = 26;
  28.   ordinal: integer = 27;
  29.   //string: integer = 28;
  30.   char: integer = 29;
  31.   wstring: integer = 30;
  32.   wchar: integer = 31;
  33.   c: integer = 32;
  34.   //as: integer = 33;
  35.   at: integer = 34;
  36.   //do: integer = 35;
  37.   //if: integer = 36;
  38.   //in: integer = 37;
  39.   //is: integer = 38;
  40.   //of: integer = 39;
  41.   //on: integer = 40;
  42.   //or: integer = 41;
  43.   //to: integer = 42;
  44.   add: integer = 43;
  45.   //and: integer = 44;
  46.   //asm: integer = 45;
  47.   //div: integer = 47;
  48.   //end: integer = 48;
  49.   far: integer = 49;
  50.   //for: integer = 50;
  51.   //mod: integer = 52;
  52.   //nil: integer = 53;
  53.   //not: integer = 54;
  54.   out: integer = 55;
  55.   //set: integer = 56;
  56.   //shl: integer = 57;
  57.   //shr: integer = 58;
  58.   //try: integer = 59;
  59.   //var: integer = 60;
  60.   //xor: integer = 61;
  61.   //case: integer = 62;
  62.   //cvar: integer = 64;
  63.   //else: integer = 65;
  64.   exit: integer = 66;
  65.   fail: integer = 67;
  66.   //file: integer = 68;
  67.   //goto: integer = 69;
  68.   huge: integer = 70;
  69.   name: integer = 71;
  70.   near: integer = 72;
  71.   read: integer = 73;
  72.   self: integer = 74;
  73.   sysv: integer = 75;
  74.   //then: integer = 76;
  75.   //type: integer = 77;
  76.   //unit: integer = 78;
  77.   univ: integer = 79;
  78.   //uses: integer = 80;
  79.   //with: integer = 81;
  80.   alias: integer = 82;
  81.   //array: integer = 83;
  82.   //begin: integer = 84;
  83.   break: integer = 85;
  84.   cdecl: integer = 86;
  85.   //class: integer = 87;
  86.   //const: integer = 88;
  87.   equal: integer = 89;
  88.   far16: integer = 90;
  89.   final: integer = 91;
  90.   index: integer = 92;
  91.   //label: integer = 93;
  92.   local: integer = 94;
  93.   //raise: integer = 95;
  94.   //until: integer = 96;
  95.   //while: integer = 97;
  96.   write: integer = 98;
  97.   cblock: integer = 100;
  98.   dispid: integer = 101;
  99.   divide: integer = 102;
  100.   //downto: integer = 103;
  101.   //except: integer = 104;
  102.   //export: integer = 105;
  103.   helper: integer = 106;
  104.   inline: integer = 107;
  105.   legacy: integer = 108;
  106.   nested: integer = 109;
  107.   //object: integer = 110;
  108.   //packed: integer = 111;
  109.   pascal: integer = 112;
  110.   //public: integer = 113;
  111.   //record: integer = 114;
  112.   //repeat: integer = 115;
  113.   result: integer = 116;
  114.   return: integer = 117;
  115.   sealed: integer = 118;
  116.   static: integer = 119;
  117.   stored: integer = 120;
  118.   strict: integer = 121;
  119.   //string: integer = 122;
  120.   winapi: integer = 124;
  121.   asmname: integer = 125;
  122.   basereg: integer = 126;
  123.   cppdecl: integer = 127;
  124.   default: integer = 128;
  125.   dynamic: integer = 129;
  126.   //exports: integer = 130;
  127.   //finally: integer = 131;
  128.   forward: integer = 132;
  129.   generic: integer = 133;
  130.   iocheck: integer = 134;
  131.   //library: integer = 135;
  132.   message: integer = 136;
  133.   modulus: integer = 137;
  134.   package: integer = 138;
  135.   private: integer = 139;
  136.   //program: integer = 140;
  137.   r12base: integer = 141;
  138.   rtlproc: integer = 142;
  139.   section: integer = 143;
  140.   stdcall: integer = 144;
  141.   syscall: integer = 145;
  142.   varargs: integer = 146;
  143.   virtual: integer = 147;
  144.   absolute: integer = 148;
  145.   abstract: integer = 149;
  146.   baselast: integer = 150;
  147.   basenone: integer = 151;
  148.   basesysv: integer = 152;
  149.   constref: integer = 153;
  150.   contains: integer = 154;
  151.   continue: integer = 155;
  152.   //cppclass: integer = 156;
  153.   //external: integer = 158;
  154.   //function: integer = 160;
  155.   implicit: integer = 161;
  156.   lessthan: integer = 162;
  157.   location: integer = 163;
  158.   multiply: integer = 164;
  159.   mwpascal: integer = 165;
  160.   negative: integer = 166;
  161.   noinline: integer = 167;
  162.   noreturn: integer = 168;
  163.   notequal: integer = 169;
  164.   //operator: integer = 170;
  165.   optional: integer = 171;
  166.   overload: integer = 172;
  167.   override: integer = 173;
  168.   platform: integer = 174;
  169.   positive: integer = 175;
  170.   //property: integer = 176;
  171.   readonly: integer = 177;
  172.   register: integer = 178;
  173.   required: integer = 179;
  174.   requires: integer = 180;
  175.   resident: integer = 181;
  176.   safecall: integer = 182;
  177.   subtract: integer = 183;
  178.   sysvbase: integer = 184;
  179.   assembler: integer = 185;
  180.   basefirst: integer = 186;
  181.   //bitpacked: integer = 187;
  182.   bitwiseor: integer = 188;
  183.   hardfloat: integer = 189;
  184.   //inherited: integer = 190;
  185.   intdivide: integer = 191;
  186.   //interface: integer = 192;
  187.   interrupt: integer = 193;
  188.   leftshift: integer = 194;
  189.   logicalor: integer = 195;
  190.   nodefault: integer = 196;
  191.   objcclass: integer = 197;
  192.   //otherwise: integer = 198;
  193.   //procedure: integer = 199;
  194.   protected: integer = 200;
  195.   published: integer = 201;
  196.   reference: integer = 202;
  197.   softfloat: integer = 203;
  198.   //threadvar: integer = 204;
  199.   writeonly: integer = 205;
  200.   bitwiseand: integer = 206;
  201.   bitwisexor: integer = 207;
  202.   deprecated: integer = 208;
  203.   //destructor: integer = 209;
  204.   //enumerator: integer = 210;
  205.   implements: integer = 211;
  206.   //initialize: integer = 212;
  207.   internproc: integer = 213;
  208.   logicaland: integer = 214;
  209.   logicalnot: integer = 215;
  210.   logicalxor: integer = 216;
  211.   oldfpccall: integer = 217;
  212.   openstring: integer = 218;
  213.   rightshift: integer = 219;
  214.   specialize: integer = 220;
  215.   vectorcall: integer = 221;
  216.   //constructor: integer = 222;
  217.   greaterthan: integer = 223;
  218.   internconst: integer = 224;
  219.   reintroduce: integer = 225;
  220.   shortstring: integer = 226;
  221.   compilerproc: integer = 227;
  222.   experimental: integer = 228;
  223.   //finalization: integer = 229;
  224.   ms_abi_cdecl: integer = 230;
  225.   nostackframe: integer = 231;
  226.   objccategory: integer = 232;
  227.   objcprotocol: integer = 233;
  228.   //weakexternal: integer = 234;
  229.   //dispinterface: integer = 235;
  230.   unimplemented: integer = 236;
  231.   //implementation: integer = 237;
  232.   //initialization: integer = 238;
  233.   ms_abi_default: integer = 239;
  234.   //resourcestring: integer = 240;
  235.   sysv_abi_cdecl: integer = 241;
  236.   lessthanorequal: integer = 242;
  237.   sysv_abi_default: integer = 243;
  238.   greaterthanorequal: integer = 244;
  239.   true: integer = 245;
  240.   false: integer = 246;
Title: Re: Message methods
Post by: pascal111 on May 16, 2021, 12:48:34 am
Fabulous! Typecasting has been used in the process of selecting the first bits from the register "record", a very clever artwork, Lazarus free Pascal is amazing, smart and artistic in its methods, we cannot in the Middle East create a language like this, this is a fact!"

Object Pascal is very nice, yes. But nothing unusual in typecasting, as mentioned above, to make a whole region like the Middle East unable to create a language like this. It is nice to compliment people and their work, but not on the expense of other people.

قد لا تُلقي بالاً لرأيكـ وتظنّه بسيطاً وقد يكون في غاية الخطورة في نظر بعض الثقافات الأخرى ،فإذا لم يُوجد عملٌ مميّزٌعند أمّةٍ ما يُثير الإعجاب لدى آخرين فهناكـ من الدوافع الأخرى التي تجعل الآخرين يظنّون أنّ تلكـ الأمّة لا تستحق الحياة.

مُهم جدّاً أن يكون لديكـ ما يُثير إعجابي جدّاً وأودّ أن أتعلّمه منكـ ،أظنّكـ الآن تفهم.

google translate:

"You may not pay any attention to your opinion and think it is simple and it may be very dangerous in the eyes of some other cultures. If there is no special work for a nation that causes admiration for others, there are other motives that make others think that that nation is not worthy of life.

It is very important that you have something that I am very impressed with and I would like to learn from you, I think you now understand."


I had seen some members here express their admiration of Object Pascal on the expense of C and C++.


Code: Pascal  [Select][+][-]
  1. var
  2.   //as: integer = 1;
  3.   //in: integer = 2;
  4.   //is: integer = 3;
  5.   //or: integer = 4;
  6.   //and: integer = 5;
  7.   //div: integer = 6;
  8.   //mod: integer = 7;
  9.   //not: integer = 8;
  10.   //shl: integer = 9;
  11.   //shr: integer = 10;
  12.   //xor: integer = 11;
  13.   explicit: integer = 12;
  14.   enumerator: integer = 13;
  15.   initialize: integer = 14;
  16.   finalize: integer = 15;
  17.   addref: integer = 16;
  18.   copy: integer = 17;
  19.   inc: integer = 18;
  20.   dec: integer = 19;
  21.   //end: integer = 20;
  22.   //of: integer = 21;
  23.   //file: integer = 22;
  24.   identifier: integer = 23;
  25.   non: integer = 24;
  26.   //const: integer = 25;
  27.   real: integer = 26;
  28.   ordinal: integer = 27;
  29.   //string: integer = 28;
  30.   char: integer = 29;
  31.   wstring: integer = 30;
  32.   wchar: integer = 31;
  33.   c: integer = 32;
  34.   //as: integer = 33;
  35.   at: integer = 34;
  36.   //do: integer = 35;
  37.   //if: integer = 36;
  38.   //in: integer = 37;
  39.   //is: integer = 38;
  40.   //of: integer = 39;
  41.   //on: integer = 40;
  42.   //or: integer = 41;
  43.   //to: integer = 42;
  44.   add: integer = 43;
  45.   //and: integer = 44;
  46.   //asm: integer = 45;
  47.   //div: integer = 47;
  48.   //end: integer = 48;
  49.   far: integer = 49;
  50.   //for: integer = 50;
  51.   //mod: integer = 52;
  52.   //nil: integer = 53;
  53.   //not: integer = 54;
  54.   out: integer = 55;
  55.   //set: integer = 56;
  56.   //shl: integer = 57;
  57.   //shr: integer = 58;
  58.   //try: integer = 59;
  59.   //var: integer = 60;
  60.   //xor: integer = 61;
  61.   //case: integer = 62;
  62.   //cvar: integer = 64;
  63.   //else: integer = 65;
  64.   exit: integer = 66;
  65.   fail: integer = 67;
  66.   //file: integer = 68;
  67.   //goto: integer = 69;
  68.   huge: integer = 70;
  69.   name: integer = 71;
  70.   near: integer = 72;
  71.   read: integer = 73;
  72.   self: integer = 74;
  73.   sysv: integer = 75;
  74.   //then: integer = 76;
  75.   //type: integer = 77;
  76.   //unit: integer = 78;
  77.   univ: integer = 79;
  78.   //uses: integer = 80;
  79.   //with: integer = 81;
  80.   alias: integer = 82;
  81.   //array: integer = 83;
  82.   //begin: integer = 84;
  83.   break: integer = 85;
  84.   cdecl: integer = 86;
  85.   //class: integer = 87;
  86.   //const: integer = 88;
  87.   equal: integer = 89;
  88.   far16: integer = 90;
  89.   final: integer = 91;
  90.   index: integer = 92;
  91.   //label: integer = 93;
  92.   local: integer = 94;
  93.   //raise: integer = 95;
  94.   //until: integer = 96;
  95.   //while: integer = 97;
  96.   write: integer = 98;
  97.   cblock: integer = 100;
  98.   dispid: integer = 101;
  99.   divide: integer = 102;
  100.   //downto: integer = 103;
  101.   //except: integer = 104;
  102.   //export: integer = 105;
  103.   helper: integer = 106;
  104.   inline: integer = 107;
  105.   legacy: integer = 108;
  106.   nested: integer = 109;
  107.   //object: integer = 110;
  108.   //packed: integer = 111;
  109.   pascal: integer = 112;
  110.   //public: integer = 113;
  111.   //record: integer = 114;
  112.   //repeat: integer = 115;
  113.   result: integer = 116;
  114.   return: integer = 117;
  115.   sealed: integer = 118;
  116.   static: integer = 119;
  117.   stored: integer = 120;
  118.   strict: integer = 121;
  119.   //string: integer = 122;
  120.   winapi: integer = 124;
  121.   asmname: integer = 125;
  122.   basereg: integer = 126;
  123.   cppdecl: integer = 127;
  124.   default: integer = 128;
  125.   dynamic: integer = 129;
  126.   //exports: integer = 130;
  127.   //finally: integer = 131;
  128.   forward: integer = 132;
  129.   generic: integer = 133;
  130.   iocheck: integer = 134;
  131.   //library: integer = 135;
  132.   message: integer = 136;
  133.   modulus: integer = 137;
  134.   package: integer = 138;
  135.   private: integer = 139;
  136.   //program: integer = 140;
  137.   r12base: integer = 141;
  138.   rtlproc: integer = 142;
  139.   section: integer = 143;
  140.   stdcall: integer = 144;
  141.   syscall: integer = 145;
  142.   varargs: integer = 146;
  143.   virtual: integer = 147;
  144.   absolute: integer = 148;
  145.   abstract: integer = 149;
  146.   baselast: integer = 150;
  147.   basenone: integer = 151;
  148.   basesysv: integer = 152;
  149.   constref: integer = 153;
  150.   contains: integer = 154;
  151.   continue: integer = 155;
  152.   //cppclass: integer = 156;
  153.   //external: integer = 158;
  154.   //function: integer = 160;
  155.   implicit: integer = 161;
  156.   lessthan: integer = 162;
  157.   location: integer = 163;
  158.   multiply: integer = 164;
  159.   mwpascal: integer = 165;
  160.   negative: integer = 166;
  161.   noinline: integer = 167;
  162.   noreturn: integer = 168;
  163.   notequal: integer = 169;
  164.   //operator: integer = 170;
  165.   optional: integer = 171;
  166.   overload: integer = 172;
  167.   override: integer = 173;
  168.   platform: integer = 174;
  169.   positive: integer = 175;
  170.   //property: integer = 176;
  171.   readonly: integer = 177;
  172.   register: integer = 178;
  173.   required: integer = 179;
  174.   requires: integer = 180;
  175.   resident: integer = 181;
  176.   safecall: integer = 182;
  177.   subtract: integer = 183;
  178.   sysvbase: integer = 184;
  179.   assembler: integer = 185;
  180.   basefirst: integer = 186;
  181.   //bitpacked: integer = 187;
  182.   bitwiseor: integer = 188;
  183.   hardfloat: integer = 189;
  184.   //inherited: integer = 190;
  185.   intdivide: integer = 191;
  186.   //interface: integer = 192;
  187.   interrupt: integer = 193;
  188.   leftshift: integer = 194;
  189.   logicalor: integer = 195;
  190.   nodefault: integer = 196;
  191.   objcclass: integer = 197;
  192.   //otherwise: integer = 198;
  193.   //procedure: integer = 199;
  194.   protected: integer = 200;
  195.   published: integer = 201;
  196.   reference: integer = 202;
  197.   softfloat: integer = 203;
  198.   //threadvar: integer = 204;
  199.   writeonly: integer = 205;
  200.   bitwiseand: integer = 206;
  201.   bitwisexor: integer = 207;
  202.   deprecated: integer = 208;
  203.   //destructor: integer = 209;
  204.   //enumerator: integer = 210;
  205.   implements: integer = 211;
  206.   //initialize: integer = 212;
  207.   internproc: integer = 213;
  208.   logicaland: integer = 214;
  209.   logicalnot: integer = 215;
  210.   logicalxor: integer = 216;
  211.   oldfpccall: integer = 217;
  212.   openstring: integer = 218;
  213.   rightshift: integer = 219;
  214.   specialize: integer = 220;
  215.   vectorcall: integer = 221;
  216.   //constructor: integer = 222;
  217.   greaterthan: integer = 223;
  218.   internconst: integer = 224;
  219.   reintroduce: integer = 225;
  220.   shortstring: integer = 226;
  221.   compilerproc: integer = 227;
  222.   experimental: integer = 228;
  223.   //finalization: integer = 229;
  224.   ms_abi_cdecl: integer = 230;
  225.   nostackframe: integer = 231;
  226.   objccategory: integer = 232;
  227.   objcprotocol: integer = 233;
  228.   //weakexternal: integer = 234;
  229.   //dispinterface: integer = 235;
  230.   unimplemented: integer = 236;
  231.   //implementation: integer = 237;
  232.   //initialization: integer = 238;
  233.   ms_abi_default: integer = 239;
  234.   //resourcestring: integer = 240;
  235.   sysv_abi_cdecl: integer = 241;
  236.   lessthanorequal: integer = 242;
  237.   sysv_abi_default: integer = 243;
  238.   greaterthanorequal: integer = 244;
  239.   true: integer = 245;
  240.   false: integer = 246;

أظنّ أنّ هذا أسلوبٌ يُشبه أسلوب لغة C++ حقّاً!

google translate:

"I think this is a really C ++ style!"
Title: Re: Message methods
Post by: engkin on May 16, 2021, 02:04:43 am
"I think this is a really C ++ style!"

That list was for your benefit. These are keywords similar to "message" that you can use as variables. See how the forum code treats some of these words in a special way like some of them turn blue/bold?
Title: Re: Message methods
Post by: engkin on May 16, 2021, 02:31:38 am
You may not pay any attention to your opinion and think it is simple and it may be very dangerous in the eyes of some other cultures.

This is a different topic. Did Google translation confuse you?

If there is no special work for a nation that causes admiration for others, there are other motives that make others think that that nation is not worthy of life.

I hope that is not the case in your eyes. When you use the word "nation", do you mean a group of people confined to some political border, a specific race, or some other meaning?

Would you consider getting rid of dictators as part of "special work"? or do you consider keeping millions of people under the boot heels of one family as "special work"?

It is very important that you have something that I am very impressed with and I would like to learn from you, I think you now understand."

Now this is bad. I do not have any intention to try to impress you or anyone else for that matter. But I do have the intention to help people learn and solve their problems.
Title: Re: Message methods
Post by: pascal111 on May 16, 2021, 12:12:28 pm
You may not pay any attention to your opinion and think it is simple and it may be very dangerous in the eyes of some other cultures.

This is a different topic. Did Google translation confuse you?

If there is no special work for a nation that causes admiration for others, there are other motives that make others think that that nation is not worthy of life.

I hope that is not the case in your eyes. When you use the word "nation", do you mean a group of people confined to some political border, a specific race, or some other meaning?

Would you consider getting rid of dictators as part of "special work"? or do you consider keeping millions of people under the boot heels of one family as "special work"?

It is very important that you have something that I am very impressed with and I would like to learn from you, I think you now understand."

Now this is bad. I do not have any intention to try to impress you or anyone else for that matter. But I do have the intention to help people learn and solve their problems.

ربّما google translate لديه مشاكل حقّاً في تأدية المعنى المقصود بين الإنجليزيّة والعربيّة. لدينا مُشكلة فعلاً فالإختلافات بين الإنجليزيّة والعربيّة أكبر ممّا كُنتُ أتصوّر ،لقد كُنتُ أتصوّر الموضوع بسيطاً لكن للأسف ليس لديّ مُترجم مجاني غير google translate.

google translate:

"Maybe google translate has really problems performing the intended meaning between english and arabic. We really have a problem, the differences between English and Arabic are greater than I could have imagined. I used to envision the topic simple, but unfortunately I do not have a free translator other than google translate."
Title: Re: Message methods
Post by: PascalDragon on May 16, 2021, 05:09:28 pm
Code: Pascal  [Select][+][-]
  1. var
  2.   //as: integer = 1;
  3.   //in: integer = 2;
  4.   //is: integer = 3;
  5.   //or: integer = 4;
  6.   //and: integer = 5;
  7.   //div: integer = 6;
  8.   //mod: integer = 7;
  9.   //not: integer = 8;
  10.   //shl: integer = 9;
  11.   //shr: integer = 10;
  12.   //xor: integer = 11;
  13.   explicit: integer = 12;
  14.   enumerator: integer = 13;
  15.   initialize: integer = 14;
  16.   finalize: integer = 15;
  17.   addref: integer = 16;
  18.   copy: integer = 17;
  19.   inc: integer = 18;
  20.   dec: integer = 19;
  21.   //end: integer = 20;
  22.   //of: integer = 21;
  23.   //file: integer = 22;
  24.   identifier: integer = 23;
  25.   non: integer = 24;
  26.   //const: integer = 25;
  27.   real: integer = 26;
  28.   ordinal: integer = 27;
  29.   //string: integer = 28;
  30.   char: integer = 29;
  31.   wstring: integer = 30;
  32.   wchar: integer = 31;
  33.   c: integer = 32;
  34.   //as: integer = 33;
  35.   at: integer = 34;
  36.   //do: integer = 35;
  37.   //if: integer = 36;
  38.   //in: integer = 37;
  39.   //is: integer = 38;
  40.   //of: integer = 39;
  41.   //on: integer = 40;
  42.   //or: integer = 41;
  43.   //to: integer = 42;
  44.   add: integer = 43;
  45.   //and: integer = 44;
  46.   //asm: integer = 45;
  47.   //div: integer = 47;
  48.   //end: integer = 48;
  49.   far: integer = 49;
  50.   //for: integer = 50;
  51.   //mod: integer = 52;
  52.   //nil: integer = 53;
  53.   //not: integer = 54;
  54.   out: integer = 55;
  55.   //set: integer = 56;
  56.   //shl: integer = 57;
  57.   //shr: integer = 58;
  58.   //try: integer = 59;
  59.   //var: integer = 60;
  60.   //xor: integer = 61;
  61.   //case: integer = 62;
  62.   //cvar: integer = 64;
  63.   //else: integer = 65;
  64.   exit: integer = 66;
  65.   fail: integer = 67;
  66.   //file: integer = 68;
  67.   //goto: integer = 69;
  68.   huge: integer = 70;
  69.   name: integer = 71;
  70.   near: integer = 72;
  71.   read: integer = 73;
  72.   self: integer = 74;
  73.   sysv: integer = 75;
  74.   //then: integer = 76;
  75.   //type: integer = 77;
  76.   //unit: integer = 78;
  77.   univ: integer = 79;
  78.   //uses: integer = 80;
  79.   //with: integer = 81;
  80.   alias: integer = 82;
  81.   //array: integer = 83;
  82.   //begin: integer = 84;
  83.   break: integer = 85;
  84.   cdecl: integer = 86;
  85.   //class: integer = 87;
  86.   //const: integer = 88;
  87.   equal: integer = 89;
  88.   far16: integer = 90;
  89.   final: integer = 91;
  90.   index: integer = 92;
  91.   //label: integer = 93;
  92.   local: integer = 94;
  93.   //raise: integer = 95;
  94.   //until: integer = 96;
  95.   //while: integer = 97;
  96.   write: integer = 98;
  97.   cblock: integer = 100;
  98.   dispid: integer = 101;
  99.   divide: integer = 102;
  100.   //downto: integer = 103;
  101.   //except: integer = 104;
  102.   //export: integer = 105;
  103.   helper: integer = 106;
  104.   inline: integer = 107;
  105.   legacy: integer = 108;
  106.   nested: integer = 109;
  107.   //object: integer = 110;
  108.   //packed: integer = 111;
  109.   pascal: integer = 112;
  110.   //public: integer = 113;
  111.   //record: integer = 114;
  112.   //repeat: integer = 115;
  113.   result: integer = 116;
  114.   return: integer = 117;
  115.   sealed: integer = 118;
  116.   static: integer = 119;
  117.   stored: integer = 120;
  118.   strict: integer = 121;
  119.   //string: integer = 122;
  120.   winapi: integer = 124;
  121.   asmname: integer = 125;
  122.   basereg: integer = 126;
  123.   cppdecl: integer = 127;
  124.   default: integer = 128;
  125.   dynamic: integer = 129;
  126.   //exports: integer = 130;
  127.   //finally: integer = 131;
  128.   forward: integer = 132;
  129.   generic: integer = 133;
  130.   iocheck: integer = 134;
  131.   //library: integer = 135;
  132.   message: integer = 136;
  133.   modulus: integer = 137;
  134.   package: integer = 138;
  135.   private: integer = 139;
  136.   //program: integer = 140;
  137.   r12base: integer = 141;
  138.   rtlproc: integer = 142;
  139.   section: integer = 143;
  140.   stdcall: integer = 144;
  141.   syscall: integer = 145;
  142.   varargs: integer = 146;
  143.   virtual: integer = 147;
  144.   absolute: integer = 148;
  145.   abstract: integer = 149;
  146.   baselast: integer = 150;
  147.   basenone: integer = 151;
  148.   basesysv: integer = 152;
  149.   constref: integer = 153;
  150.   contains: integer = 154;
  151.   continue: integer = 155;
  152.   //cppclass: integer = 156;
  153.   //external: integer = 158;
  154.   //function: integer = 160;
  155.   implicit: integer = 161;
  156.   lessthan: integer = 162;
  157.   location: integer = 163;
  158.   multiply: integer = 164;
  159.   mwpascal: integer = 165;
  160.   negative: integer = 166;
  161.   noinline: integer = 167;
  162.   noreturn: integer = 168;
  163.   notequal: integer = 169;
  164.   //operator: integer = 170;
  165.   optional: integer = 171;
  166.   overload: integer = 172;
  167.   override: integer = 173;
  168.   platform: integer = 174;
  169.   positive: integer = 175;
  170.   //property: integer = 176;
  171.   readonly: integer = 177;
  172.   register: integer = 178;
  173.   required: integer = 179;
  174.   requires: integer = 180;
  175.   resident: integer = 181;
  176.   safecall: integer = 182;
  177.   subtract: integer = 183;
  178.   sysvbase: integer = 184;
  179.   assembler: integer = 185;
  180.   basefirst: integer = 186;
  181.   //bitpacked: integer = 187;
  182.   bitwiseor: integer = 188;
  183.   hardfloat: integer = 189;
  184.   //inherited: integer = 190;
  185.   intdivide: integer = 191;
  186.   //interface: integer = 192;
  187.   interrupt: integer = 193;
  188.   leftshift: integer = 194;
  189.   logicalor: integer = 195;
  190.   nodefault: integer = 196;
  191.   objcclass: integer = 197;
  192.   //otherwise: integer = 198;
  193.   //procedure: integer = 199;
  194.   protected: integer = 200;
  195.   published: integer = 201;
  196.   reference: integer = 202;
  197.   softfloat: integer = 203;
  198.   //threadvar: integer = 204;
  199.   writeonly: integer = 205;
  200.   bitwiseand: integer = 206;
  201.   bitwisexor: integer = 207;
  202.   deprecated: integer = 208;
  203.   //destructor: integer = 209;
  204.   //enumerator: integer = 210;
  205.   implements: integer = 211;
  206.   //initialize: integer = 212;
  207.   internproc: integer = 213;
  208.   logicaland: integer = 214;
  209.   logicalnot: integer = 215;
  210.   logicalxor: integer = 216;
  211.   oldfpccall: integer = 217;
  212.   openstring: integer = 218;
  213.   rightshift: integer = 219;
  214.   specialize: integer = 220;
  215.   vectorcall: integer = 221;
  216.   //constructor: integer = 222;
  217.   greaterthan: integer = 223;
  218.   internconst: integer = 224;
  219.   reintroduce: integer = 225;
  220.   shortstring: integer = 226;
  221.   compilerproc: integer = 227;
  222.   experimental: integer = 228;
  223.   //finalization: integer = 229;
  224.   ms_abi_cdecl: integer = 230;
  225.   nostackframe: integer = 231;
  226.   objccategory: integer = 232;
  227.   objcprotocol: integer = 233;
  228.   //weakexternal: integer = 234;
  229.   //dispinterface: integer = 235;
  230.   unimplemented: integer = 236;
  231.   //implementation: integer = 237;
  232.   //initialization: integer = 238;
  233.   ms_abi_default: integer = 239;
  234.   //resourcestring: integer = 240;
  235.   sysv_abi_cdecl: integer = 241;
  236.   lessthanorequal: integer = 242;
  237.   sysv_abi_default: integer = 243;
  238.   greaterthanorequal: integer = 244;
  239.   true: integer = 245;
  240.   false: integer = 246;

If you prefix the keywords with & (e.g. &begin) you can use them as identifiers as well.
Title: Re: Message methods
Post by: pascal111 on May 16, 2021, 07:09:14 pm
Code: Pascal  [Select][+][-]
  1. var
  2.   //as: integer = 1;
  3.   //in: integer = 2;
  4.   //is: integer = 3;
  5.   //or: integer = 4;
  6.   //and: integer = 5;
  7.   //div: integer = 6;
  8.   //mod: integer = 7;
  9.   //not: integer = 8;
  10.   //shl: integer = 9;
  11.   //shr: integer = 10;
  12.   //xor: integer = 11;
  13.   explicit: integer = 12;
  14.   enumerator: integer = 13;
  15.   initialize: integer = 14;
  16.   finalize: integer = 15;
  17.   addref: integer = 16;
  18.   copy: integer = 17;
  19.   inc: integer = 18;
  20.   dec: integer = 19;
  21.   //end: integer = 20;
  22.   //of: integer = 21;
  23.   //file: integer = 22;
  24.   identifier: integer = 23;
  25.   non: integer = 24;
  26.   //const: integer = 25;
  27.   real: integer = 26;
  28.   ordinal: integer = 27;
  29.   //string: integer = 28;
  30.   char: integer = 29;
  31.   wstring: integer = 30;
  32.   wchar: integer = 31;
  33.   c: integer = 32;
  34.   //as: integer = 33;
  35.   at: integer = 34;
  36.   //do: integer = 35;
  37.   //if: integer = 36;
  38.   //in: integer = 37;
  39.   //is: integer = 38;
  40.   //of: integer = 39;
  41.   //on: integer = 40;
  42.   //or: integer = 41;
  43.   //to: integer = 42;
  44.   add: integer = 43;
  45.   //and: integer = 44;
  46.   //asm: integer = 45;
  47.   //div: integer = 47;
  48.   //end: integer = 48;
  49.   far: integer = 49;
  50.   //for: integer = 50;
  51.   //mod: integer = 52;
  52.   //nil: integer = 53;
  53.   //not: integer = 54;
  54.   out: integer = 55;
  55.   //set: integer = 56;
  56.   //shl: integer = 57;
  57.   //shr: integer = 58;
  58.   //try: integer = 59;
  59.   //var: integer = 60;
  60.   //xor: integer = 61;
  61.   //case: integer = 62;
  62.   //cvar: integer = 64;
  63.   //else: integer = 65;
  64.   exit: integer = 66;
  65.   fail: integer = 67;
  66.   //file: integer = 68;
  67.   //goto: integer = 69;
  68.   huge: integer = 70;
  69.   name: integer = 71;
  70.   near: integer = 72;
  71.   read: integer = 73;
  72.   self: integer = 74;
  73.   sysv: integer = 75;
  74.   //then: integer = 76;
  75.   //type: integer = 77;
  76.   //unit: integer = 78;
  77.   univ: integer = 79;
  78.   //uses: integer = 80;
  79.   //with: integer = 81;
  80.   alias: integer = 82;
  81.   //array: integer = 83;
  82.   //begin: integer = 84;
  83.   break: integer = 85;
  84.   cdecl: integer = 86;
  85.   //class: integer = 87;
  86.   //const: integer = 88;
  87.   equal: integer = 89;
  88.   far16: integer = 90;
  89.   final: integer = 91;
  90.   index: integer = 92;
  91.   //label: integer = 93;
  92.   local: integer = 94;
  93.   //raise: integer = 95;
  94.   //until: integer = 96;
  95.   //while: integer = 97;
  96.   write: integer = 98;
  97.   cblock: integer = 100;
  98.   dispid: integer = 101;
  99.   divide: integer = 102;
  100.   //downto: integer = 103;
  101.   //except: integer = 104;
  102.   //export: integer = 105;
  103.   helper: integer = 106;
  104.   inline: integer = 107;
  105.   legacy: integer = 108;
  106.   nested: integer = 109;
  107.   //object: integer = 110;
  108.   //packed: integer = 111;
  109.   pascal: integer = 112;
  110.   //public: integer = 113;
  111.   //record: integer = 114;
  112.   //repeat: integer = 115;
  113.   result: integer = 116;
  114.   return: integer = 117;
  115.   sealed: integer = 118;
  116.   static: integer = 119;
  117.   stored: integer = 120;
  118.   strict: integer = 121;
  119.   //string: integer = 122;
  120.   winapi: integer = 124;
  121.   asmname: integer = 125;
  122.   basereg: integer = 126;
  123.   cppdecl: integer = 127;
  124.   default: integer = 128;
  125.   dynamic: integer = 129;
  126.   //exports: integer = 130;
  127.   //finally: integer = 131;
  128.   forward: integer = 132;
  129.   generic: integer = 133;
  130.   iocheck: integer = 134;
  131.   //library: integer = 135;
  132.   message: integer = 136;
  133.   modulus: integer = 137;
  134.   package: integer = 138;
  135.   private: integer = 139;
  136.   //program: integer = 140;
  137.   r12base: integer = 141;
  138.   rtlproc: integer = 142;
  139.   section: integer = 143;
  140.   stdcall: integer = 144;
  141.   syscall: integer = 145;
  142.   varargs: integer = 146;
  143.   virtual: integer = 147;
  144.   absolute: integer = 148;
  145.   abstract: integer = 149;
  146.   baselast: integer = 150;
  147.   basenone: integer = 151;
  148.   basesysv: integer = 152;
  149.   constref: integer = 153;
  150.   contains: integer = 154;
  151.   continue: integer = 155;
  152.   //cppclass: integer = 156;
  153.   //external: integer = 158;
  154.   //function: integer = 160;
  155.   implicit: integer = 161;
  156.   lessthan: integer = 162;
  157.   location: integer = 163;
  158.   multiply: integer = 164;
  159.   mwpascal: integer = 165;
  160.   negative: integer = 166;
  161.   noinline: integer = 167;
  162.   noreturn: integer = 168;
  163.   notequal: integer = 169;
  164.   //operator: integer = 170;
  165.   optional: integer = 171;
  166.   overload: integer = 172;
  167.   override: integer = 173;
  168.   platform: integer = 174;
  169.   positive: integer = 175;
  170.   //property: integer = 176;
  171.   readonly: integer = 177;
  172.   register: integer = 178;
  173.   required: integer = 179;
  174.   requires: integer = 180;
  175.   resident: integer = 181;
  176.   safecall: integer = 182;
  177.   subtract: integer = 183;
  178.   sysvbase: integer = 184;
  179.   assembler: integer = 185;
  180.   basefirst: integer = 186;
  181.   //bitpacked: integer = 187;
  182.   bitwiseor: integer = 188;
  183.   hardfloat: integer = 189;
  184.   //inherited: integer = 190;
  185.   intdivide: integer = 191;
  186.   //interface: integer = 192;
  187.   interrupt: integer = 193;
  188.   leftshift: integer = 194;
  189.   logicalor: integer = 195;
  190.   nodefault: integer = 196;
  191.   objcclass: integer = 197;
  192.   //otherwise: integer = 198;
  193.   //procedure: integer = 199;
  194.   protected: integer = 200;
  195.   published: integer = 201;
  196.   reference: integer = 202;
  197.   softfloat: integer = 203;
  198.   //threadvar: integer = 204;
  199.   writeonly: integer = 205;
  200.   bitwiseand: integer = 206;
  201.   bitwisexor: integer = 207;
  202.   deprecated: integer = 208;
  203.   //destructor: integer = 209;
  204.   //enumerator: integer = 210;
  205.   implements: integer = 211;
  206.   //initialize: integer = 212;
  207.   internproc: integer = 213;
  208.   logicaland: integer = 214;
  209.   logicalnot: integer = 215;
  210.   logicalxor: integer = 216;
  211.   oldfpccall: integer = 217;
  212.   openstring: integer = 218;
  213.   rightshift: integer = 219;
  214.   specialize: integer = 220;
  215.   vectorcall: integer = 221;
  216.   //constructor: integer = 222;
  217.   greaterthan: integer = 223;
  218.   internconst: integer = 224;
  219.   reintroduce: integer = 225;
  220.   shortstring: integer = 226;
  221.   compilerproc: integer = 227;
  222.   experimental: integer = 228;
  223.   //finalization: integer = 229;
  224.   ms_abi_cdecl: integer = 230;
  225.   nostackframe: integer = 231;
  226.   objccategory: integer = 232;
  227.   objcprotocol: integer = 233;
  228.   //weakexternal: integer = 234;
  229.   //dispinterface: integer = 235;
  230.   unimplemented: integer = 236;
  231.   //implementation: integer = 237;
  232.   //initialization: integer = 238;
  233.   ms_abi_default: integer = 239;
  234.   //resourcestring: integer = 240;
  235.   sysv_abi_cdecl: integer = 241;
  236.   lessthanorequal: integer = 242;
  237.   sysv_abi_default: integer = 243;
  238.   greaterthanorequal: integer = 244;
  239.   true: integer = 245;
  240.   false: integer = 246;

If you prefix the keywords with & (e.g. &begin) you can use them as identifiers as well.

غريب! إذْ لم يكن مسموحاً في فترة الـ DOS في اللغات العاملة تحته أنْ تُستخدم كلمةٌ مُسجّلة والآن نرى كما أشار @engkin وكما أشرت أنت أنّهُ يُمكن إستخدامها كمعرّفاتٍ ولو بتهيئةٍ بسيطة مثل إضافة "&" ،ربّما ذلكـ من باب زيادة مُرونة اللغة.

google translate:

"a stranger"Strange"! "as" If in the period of DOS in the working languages ​​under it it was not allowed to use a registered "reserved" word, and now we see as indicated "mentioned" by @engkin and as you indicated "mentioned" that it can be used as identifiers, even with a simple configuration such as adding "&", perhaps in order to increase the flexibility of the language."
Title: Re: Message methods
Post by: VTwin on May 16, 2021, 11:49:39 pm
If you prefix the keywords with & (e.g. &begin) you can use them as identifiers as well.

Not something I am likely to use, but interesting to know none the less.
Title: Re: Message methods
Post by: pascal111 on May 17, 2021, 12:55:01 am
If you prefix the keywords with & (e.g. &begin) you can use them as identifiers as well.

Not something I am likely to use, but interesting to know none the less.

ليس خليقٌ بكـ إستعمالها ولكنّكـ تُريدُ معرفتها رغم ذلكـ!

معرفة المعلومات المُفيدة في البرمجة لا تضر حتّى لو لم تكن من نفس أسلوب برمجتنا.

google translate:

"It is not appropriate "likely" for you to use it, but you want to know it nonetheless!

Knowing useful information in programming does not harm even if it is not of the same programming style as we do."
Title: Re: Message methods
Post by: PascalDragon on May 17, 2021, 09:14:36 am
"a stranger"Strange"! "as" If in the period of DOS in the working languages ​​under it it was not allowed to use a registered "reserved" word, and now we see as indicated "mentioned" by @engkin and as you indicated "mentioned" that it can be used as identifiers, even with a simple configuration such as adding "&", perhaps in order to increase the flexibility of the language."

It was originally introduced for COM dispatch interface support. There you can have code like this when named arguments are used:

Code: Pascal  [Select][+][-]
  1. var
  2.   v: OleVariant;
  3. begin
  4.   v := CreateTheDispatchIntf;
  5.   v.SomeFunc(&Begin:=21, &End:=42);
  6. end.

And as they're named arguments they need to be passed to the dispatch interface as is as the interface is possibly provided by some third party software (e.g. Microsoft Office or whatever), thus the usual tricks of using e.g. _begin won't work.
Title: Re: Message methods
Post by: pascal111 on May 17, 2021, 01:53:34 pm
"a stranger"Strange"! "as" If in the period of DOS in the working languages ​​under it it was not allowed to use a registered "reserved" word, and now we see as indicated "mentioned" by @engkin and as you indicated "mentioned" that it can be used as identifiers, even with a simple configuration such as adding "&", perhaps in order to increase the flexibility of the language."

It was originally introduced for COM dispatch interface support. There you can have code like this when named arguments are used:

Code: Pascal  [Select][+][-]
  1. var
  2.   v: OleVariant;
  3. begin
  4.   v := CreateTheDispatchIntf;
  5.   v.SomeFunc(&Begin:=21, &End:=42);
  6. end.

And as they're named arguments they need to be passed to the dispatch interface as is as the interface is possibly provided by some third party software (e.g. Microsoft Office or whatever), thus the usual tricks of using e.g. _begin won't work.

هذه معلومة دقيقة ومُتقدّمة فلم أستخدم أو أقرأ عن الـ OLE من قبل وبالنّظر في الرابط التالي يبدو أنّ هذا موضوع مُتقدّم بعض الشيء في البرمجة المرئيّة https://wiki.freepascal.org/Olevariant (https://wiki.freepascal.org/Olevariant)

google translate:

"This is accurate and advanced information. I have not used or read about OLE before. By looking at the following link, it seems that this topic is somewhat advanced in visual programming  https://wiki.freepascal.org/Olevariant  (https://wiki.freepascal.org/Olevariant)"
Title: Re: Message methods
Post by: PascalDragon on May 18, 2021, 09:04:14 am
"This is accurate and advanced information. I have not used or read about OLE before. By looking at the following link, it seems that this topic is somewhat advanced in visual programming  https://wiki.freepascal.org/Olevariant  (https://wiki.freepascal.org/Olevariant)"

It's advanced, yes (though Object Pascal greatly simplifies it compared to e.g. C++), but it's not only visual programming: OLE (and COM) are very prevalent in the Windows world and you can use them to interface with Microsoft Office, Internet Explorer, Windows Management Instrumentation, Windows Explorer, Active Directory, OLE DB, etc.
Title: Re: Message methods
Post by: pascal111 on May 18, 2021, 12:03:59 pm
"This is accurate and advanced information. I have not used or read about OLE before. By looking at the following link, it seems that this topic is somewhat advanced in visual programming  https://wiki.freepascal.org/Olevariant  (https://wiki.freepascal.org/Olevariant)"

It's advanced, yes (though Object Pascal greatly simplifies it compared to e.g. C++), but it's not only visual programming: OLE (and COM) are very prevalent in the Windows world and you can use them to interface with Microsoft Office, Internet Explorer, Windows Management Instrumentation, Windows Explorer, Active Directory, OLE DB, etc.

الآن إتضحت الصورة أكثر وأظنّني فهمتُ الغاية وهي إدراج بعض العناصر الجاهزة من برامج أخرى إلى البرنامج الذي نُبرمجه على Lazarus أظنّني سمعتُ نفس الشيء في فترة VB6 فقد كانت VB6 تصنع نفس الشيء والآن من الجيّد أنّ هذه الميزة المرنة موجودة كذلكـ في Lazarus.

google translate:

"Now the picture becomes clearer and I think I understood the purpose which is to include some ready-made elements from other programs into the program that we program on Lazarus. I think I heard the same thing in the period of VB6, VB6 was doing the same thing and now it is good that this flexible feature is also present in Lazarus."
TinyPortal © 2005-2018