Get array element in memory

General discussion on mikroPascal PRO for PIC.
Post Reply
Author
Message
OhRio
Posts: 2
Joined: 04 Oct 2021 07:46

Get array element in memory

#1 Post by OhRio » 18 Sep 2022 11:31

Hello
What i want to do is send a bitmap (a byte array) as a function parameter and want to access the individual elements of the array within the function :

For example:

Code: Select all

const icon: array [32] of byte = (
0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xC0, 0x80, 0x80, 0xC0, 0xE0,
0xF0, 0xF8, 0xFC, 0xFE, 0xFF, 0xFE, 0xFC, 0x78, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);

procedure displaybitmap(const Bmp: ^byte);
begin
  //how to access value of nth element of bmp, for example value of icon[11] is  0xC0
  
end;

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: Get array element in memory

#2 Post by filip » 21 Sep 2022 13:07

Hi,

I believe I have answered here :
viewtopic.php?f=218&t=79504

Regards,
Filip.

Post Reply

Return to “mikroPascal PRO for PIC General”