Recent

Author Topic: "longbool" defintion document [SOLVED]  (Read 1907 times)

pascal111

  • Sr. Member
  • ****
  • Posts: 287
  • Un trabajo en equipo para programas serias.
"longbool" defintion document [SOLVED]
« on: May 27, 2021, 06:25:38 pm »
بحثتُ عن الـ cbool الخاص بوحدة الـ BaseUnix فكان تعريفه في الملف الذي يُدعى aliasctp.inc وكان الـ cbool يُساوي UnixType.cbool فبحثتُ عن هذه القيمة الأخيرة فكانت في ملف يُدعى ctypes.inc وكانت قيمة الـ cbool الأخيرة تُساوي longbool ولكنني بحثتُ عن تعريف للـ longbool في الوثائق فلم أجد له تعريفاً ،فأين يُمكنني أن أجد تعريف أو وصف الـ longbool سواءاً في ملفات كود أو في شروح وثائق؟

google translate:

"I searched for the baseUnix unit's cbool and its definition was in the file called aliasctp.inc and cbool was equal to UnixType.cbool, so I looked for this last value and it was in a file called ctypes.inc and the last value of cbool was equal to longbool, but I looked for a definition for longbool in The documents "and I" did not find a definition for it, so where can I find the definition or description of the longbool, either in code files or in document annotations?"

ctypes.inc
Code: Pascal  [Select][+][-]
  1. cbool                  = longbool;           pcbool                 = ^cbool;
  2.  
« Last Edit: May 27, 2021, 09:51:07 pm by pascal111 »

ASerge

  • Hero Member
  • *****
  • Posts: 1817
Re: "longbool" defintion document
« Reply #1 on: May 27, 2021, 06:50:45 pm »
so where can I find the definition or description of the longbool, either in code files or in document annotations?"
Type LongBool in Lazarus, press F1 and it will immediately show help that it is a predefined boolean type.

PS: I understand your attempt to leave the opportunity for people who speak the same language with you to understand more precisely what you are communicating. But I assure you that other forum participants will definitely not do this, and there are so many languages... Imagine that each response will be duplicated by a message in their native language, and even constantly interspersed with the phrase "google translate". I suggest that you do not clutter up the message and leave the internal work on translating to your language and back outside the framework of the forum.

pascal111

  • Sr. Member
  • ****
  • Posts: 287
  • Un trabajo en equipo para programas serias.
Re: "longbool" defintion document
« Reply #2 on: May 27, 2021, 08:00:26 pm »
so where can I find the definition or description of the longbool, either in code files or in document annotations?"
Type LongBool in Lazarus, press F1 and it will immediately show help that it is a predefined boolean type.

جيّد! فلماذا longbool عبارة عن 4 بايتات بينما boolean هو بايت واحد فقط بالرغم أنّ كلا النّوعين مُتشابهين وفق هذا الرابط:
https://wiki.freepascal.org/Longbool

google translate:

"good! So why longbool is 4 bytes while boolean is only 1 byte even though both types are similar according to this link:
https://wiki.freepascal.org/Longbool "

PS: I understand your attempt to leave the opportunity for people who speak the same language with you to understand more precisely what you are communicating. But I assure you that other forum participants will definitely not do this, and there are so many languages... Imagine that each response will be duplicated by a message in their native language, and even constantly interspersed with the phrase "google translate". I suggest that you do not clutter up the message and leave the internal work on translating to your language and back outside the framework of the forum.

ليس صحيحاً! مُحاولتُكـ لتفرّس كيف أفكّر لم تُصب هذه المرّة ،لابدّ أنّها طريقة تفكير شخص عربي آخر.

الحقيقة أنّني أكتبُ بالعربيّة ﻷنّ هناكـ كلمات كثيرة جدّاً في الإنجليزيّة لا أعرفها وأجدُ صعوبةً في تكوين الجمل وصعوبة في مُحاولة إيصال المعنى بالإنجليزيّة ،فإنجليزيّتي ليست قويّة مثل عربيّتي وكذلكـ للأسف لا يُوجد قسم في المنتدى لمن يُجيدون العربيّة وكذلكـ لا يهمّني إهتمام القارئ العربي لما أكتبُه ﻷنّني لا أهتم إلا ﻷصحاب العقول فقط.

google translate:

"Not right! Your attempt to explain how I think did not hurt"correct" this time, it must be the thinking of another Arab person.

The truth is that I write in Arabic because there are too many words in English that I do not know, and I find it difficult to form sentences and difficult in trying to convey the meaning in English, for my English is not as strong as my Arabic, and unfortunately there is no section in the forum for those who are fluent in Arabic, and I do not care about the Arab reader's interest in what I write because I do not, I only care for people with minds only."
« Last Edit: May 27, 2021, 08:02:10 pm by pascal111 »

MarkMLl

  • Hero Member
  • *****
  • Posts: 2877
Re: "longbool" defintion document
« Reply #3 on: May 27, 2021, 08:07:33 pm »
google translate:

"good! So why longbool is 4 bytes while boolean is only 1 byte even though both types are similar according to this link:
https://wiki.freepascal.org/Longbool "

That's a wiki page so has been provided by somebody on a "best effort" basis. Refer to the documentation at

https://www.freepascal.org/docs-html/current/ref/refsu4.html#x26-250003.1.1

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

pascal111

  • Sr. Member
  • ****
  • Posts: 287
  • Un trabajo en equipo para programas serias.
Re: "longbool" defintion document
« Reply #4 on: May 27, 2021, 08:38:11 pm »
google translate:

"good! So why longbool is 4 bytes while boolean is only 1 byte even though both types are similar according to this link:
https://wiki.freepascal.org/Longbool "

That's a wiki page so has been provided by somebody on a "best effort" basis. Refer to the documentation at

https://www.freepascal.org/docs-html/current/ref/refsu4.html#x26-250003.1.1

MarkMLl

في الرّابط الذي زوّدتني به وردت العبارات التاليّة وهي تتحدّث عن الـ longbool:

google translate:

"In the link that you provided me, the following phrases were mentioned while talking about the longbool:"

Quote
To make interfacing with C even easier, Free Pascal also supports the ByteBool, WordBool, LongBool and QWordBool types. These are of type Byte, Word, Longint or Int64, but are again assignment compatible with a Boolean. The only difference with the Boolean16/32/64 types is in what values are considered true or false: The value False is equivalent to 0 (zero) and any nonzero value is considered True when converting to a boolean value. A boolean value of True is converted to Not(0) in case it is assigned to a variable of type ByteBool, WordBool, LongBool or QWordBool.

أفهم من ذلكـ أنّ هذه الأنواع المنطقيّة الإضافيّة والتي هي في الحقيقة أنواع بيانات صحيحة إنّما هي من أجل عمل توافق ما مع كود من لغة C.

google translate:

"I understand from this that these additional logical types, which are actually valid  "integer" data types, are intended for compatibility with C code."

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 9458
  • FPC developer.
Re: "longbool" defintion document
« Reply #5 on: May 27, 2021, 09:17:09 pm »
Yes, so FPC has basically 8 boolean types.

  • 4 "Pascal" types, with 0 =false 1=true, rest undefined in sizes of 1,2,4,8 bytes.   boolean8,16,32,64  with just  boolean=boolean8
  • 4 "C" types, with 0 =false, not equal to 0 =true, in sizes of 1,2,4,8 bytes. bytebool, wordbool, longbool, qwordbool

So one dimension is the convention what is true and what is zero, the other is the size to match the size in whatever is delcared in a record.

pascal111

  • Sr. Member
  • ****
  • Posts: 287
  • Un trabajo en equipo para programas serias.
Re: "longbool" defintion document
« Reply #6 on: May 27, 2021, 09:50:37 pm »
Yes, so FPC has basically 8 boolean types.

  • 4 "Pascal" types, with 0 =false 1=true, rest undefined in sizes of 1,2,4,8 bytes.   boolean8,16,32,64  with just  boolean=boolean8
  • 4 "C" types, with 0 =false, not equal to 0 =true, in sizes of 1,2,4,8 bytes. bytebool, wordbool, longbool, qwordbool

So one dimension is the convention what is true and what is zero, the other is the size to match the size in whatever is delcared in a record.

هذا مثال على التنوّع. أظنّ أنّكـ تكلّمت بطريقةٍ مُوجزة جدّاً فلا تتحرّج من وضع بعض التفاصيل فلديّ قاموس بالإضافة إلى google translate ومعرفتي لبعض الكلمات الشائعة.

google translate:

"This is an example of diversity. I think you spoke in a very brief way so do not shy away "feel in criticality" from putting in some details as I have a dictionary in addition to google translate and my knowledge of some common words."

 

TinyPortal © 2005-2018