Equivalent FreePascal code lazarus / 21-General ---------------------------------------------------------------------- gii · 2021-02-16 18:18 I have the following delphi code. How to adapt it to freepascal without using {$ mode Delphi}? Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure Test(RawData: array of Byte);var  Msg: array of Byte;begin    Msg := [$81];   if Length(RawData) <= 125 then    Msg := Msg + [Length(RawData)]  else if (Length(RawData) >= 126) and (Length(RawData) <= 65535) then    Msg := Msg + [126, (Length(RawData) shr 8) and 255, Length(RawData) and 255]  else    Msg := Msg + [127, (int64(Length(RawData)) shr 56) and 255, (int64(Length(RawData)) shr 48) and 255,      (int64(Length(RawData)) shr 40) and 255, (int64(Length(RawData)) shr 32) and 255,      (Length(RawData) shr 24) and 255, (Length(RawData) shr 16) and 255, (Length(RawData) shr 8) and 255, Length(RawData) and 255];   Msg := Msg + RawData;   // ....end; ---------------------------------------------------------------------- gii · 2021-02-16 18:30 Sorry for my ignorance. I solved my problem with a quick search. I added {$ modeswitch arrayoperators}. ---------------------------------------------------------------------- MarkMLl · 2021-02-16 18:33 Quote from: gii on February 16, 2021, 07:30:22 pmSorry for my ignorance. I solved my problem with a quick search. I added {$ modeswitch arrayoperators}. Don't apologise, that's more than most people would do :-) MarkMLl ---------------------------------------------------------------------- vfclists · 2021-02-16 21:20 Quote from: gii on February 16, 2021, 07:30:22 pmSorry for my ignorance. I solved my problem with a quick search. I added {$ modeswitch arrayoperators}. Never seen that. I don't think I would have found it. ---------------------------------------------------------------------- MarkMLl · 2021-02-16 21:53 Quote from: vfclists on February 16, 2021, 10:20:13 pmNever seen that. I don't think I would have found it. I've seen it discussed. Whether I'd have /remembered/ seeing it discussed is a different matter ;-) Definite kudos to OP. MarkMLl [Edited to fix quotation :-] ---------------------------------------------------------------------- PascalDragon · 2021-02-17 08:22 Quote from: vfclists on February 16, 2021, 10:20:13 pmQuote from: gii on February 16, 2021, 07:30:22 pmSorry for my ignorance. I solved my problem with a quick search. I added {$ modeswitch arrayoperators}. Never seen that. I don't think I would have found it. It's an addition of FPC 3.2.0. Probably should be better documented in the Language Reference Guide section about dynamic arrays...