Recent

Author Topic: [SOLVED]A case of blindness, probably. Old hands, plz help.  (Read 878 times)

dseligo

  • Hero Member
  • *****
  • Posts: 1340
Re: [SOLVED]A case of blindness, probably. Old hands, plz help.
« Reply #30 on: September 04, 2024, 07:17:43 pm »
AND most important, if you pass an array to a procedure or function it is always 0 based in FPC, Delphi etc...

Try this:
Code: Pascal  [Select][+][-]
  1. type TMyArray = array[-100..100] of integer;
  2.  
  3. procedure Test(AData: TMyArray);
  4. begin
  5.   WriteLn(Low(AData), ' - ', High(AData));
  6. end;
  7.  
  8. var A: TMyArray;
  9.  
  10. begin
  11.   Test(A);
  12. end.

Thaddy

  • Hero Member
  • *****
  • Posts: 15516
  • Censorship about opinions does not belong here.
Re: [SOLVED]A case of blindness, probably. Old hands, plz help.
« Reply #31 on: September 04, 2024, 07:22:14 pm »
AND most important, if you pass an array to a procedure or function it is always 0 based in FPC, Delphi etc...

Try this:
Code: Pascal  [Select][+][-]
  1. type TMyArray = array[-100..100] of integer;
  2.  
  3. procedure Test(AData: TMyArray);
  4. begin
  5.   WriteLn(Low(AData), ' - ', High(AData));
  6. end;
  7.  
  8. var A: TMyArray;
  9.  
  10. begin
  11.   Test(A);
  12. end.


i think you are on the wrong thread?
My great hero has found the key to the highway. Rest in peace John Mayall.
Playing: "Broken Wings" in your honour. As well as taking out some mouth organs.

 

TinyPortal © 2005-2018