### Bookstore

 Computer Math and Games in Pascal (preview) Lazarus Handbook

### Author Topic: [Solved] SysUtils has strange IFDEFs  (Read 825 times)

#### AlexTP

• Hero Member
• Posts: 1766
##### [Solved] SysUtils has strange IFDEFs
« on: January 24, 2022, 04:34:28 pm »
I find it bad that 'TBytes' is not described in the wiki (I cannot find the topic). But wiki has a lot of pages for primitive types and/or funcs.
« Last Edit: January 24, 2022, 05:23:37 pm by Alextp »

#### AlexTP

• Hero Member
• Posts: 1766
##### Re: Wiki does not have page for TBytes
« Reply #1 on: January 24, 2022, 04:37:28 pm »
Ah, TBytes is just 'array of byte'. Solved.
BTW, this place in SysUtils has rather strange IFDEFs. Why first int consttant is not ok?
Code: Pascal  [Select][+][-]
1.    PByteArray = ^TByteArray;
2.    TByteArray = Array[0..{\$ifdef CPU16}32766{\$else}32767{\$endif}] of Byte;
3.
4.    PWordarray = ^TWordArray;
5.    TWordArray = array[0..{\$ifdef CPU16}16382{\$else}16383{\$endif}] of Word;
6.

#### ccrause

• Hero Member
• Posts: 568
##### Re: Wiki does not have page for TBytes
« Reply #2 on: January 24, 2022, 05:16:55 pm »
Ah, TBytes is just 'array of byte'. Solved.
BTW, this place in SysUtils has rather strange IFDEFs. Why first int consttant is not ok?
Code: Pascal  [Select][+][-]
1.    PByteArray = ^TByteArray;
2.    TByteArray = Array[0..{\$ifdef CPU16}32766{\$else}32767{\$endif}] of Byte;
3.
4.    PWordarray = ^TWordArray;
5.    TWordArray = array[0..{\$ifdef CPU16}16382{\$else}16383{\$endif}] of Word;
6.
There is a short note attached to that specific commit: * size of TByteArray and TWordArray reduced by 1 on 16-bit CPUs to avoid 'structure too large' errors when compiling the sysutils unit

#### AlexTP

• Hero Member
• Posts: 1766
##### Re: SysUtils has rather strange IFDEFs
« Reply #3 on: January 24, 2022, 05:23:21 pm »
Okay, it's now clear.