if you want to "rotate" - that is, make first numbers re-appear after last ones - then probably there is no simple way, you just can not copy a pat of array, if you need a circular queue.
you can do something like this
procedure LCD_OUT_CHAR(const LCD_char_No: byte; Const ch: char);
begin ... output one char in a given position.... end;
var
sign : array [0..3] OF CHAR;
i, shift: integer;
begin
shift := 0; // 1, 2, 3
for i := 0 to 3 do
LCD_OUT_CHAR( i, sign[ (i + shift) mod 4 ]);
end;
Judging by ZVONI's link, you can probably bridge the first funciton as
procedure LCD_OUT_CHAR(const LCD_char_No: byte; Const ch: char);
begin
Lcd_Chr(
1, // or whatever row you choose
1 + LCD_char_No,
Ord(ch) // or byte(ch)
);
end;
But not sure what their starting coordinates are
You can also generalize it somewhat.
in Delphi/FPC it could look like this (not sure how you can adapt it to Mikroe)
{$PointerMath ON}
procedure LCD_OUT_CHAR(const LCD_char_No: byte; Const ch: char);
begin ... output one char in a given position.... end;
procedure LCD_OUT_WRAPPED(
const LCD_Length: integer; // how many letters in LCD
const Array_Length: integer; // how many letters in string
const Array_ptr: PChar // first leter
const Array_shift: integer; // n-th letter of string to be put to zero-th place of LCD
);
var
i: integer;
begin
for i := 0 to LCD_Length - 1 do
LCD_OUT_CHAR( i, Array_ptr[ (i + Array_shift) mod Array_Length ]);
end;
....
var
sign : array [0..3] OF CHAR;
...
LCD_OUT_WRAPPED(12, 4, @sign[0], 2 );
Sleep(1000);
LCD_OUT_WRAPPED(12, 4, @sign[0], 3 );
Sleep(1000);
LCD_OUT_WRAPPED(12, 4, @sign[0], 4 );
Not sure if C-style "pointer maths" is available in Mikroe, but you an replace it with explicit pointer operations.
Or, using "open array" type of procedure declaration (TurboPascal and compatibles, not sure about Mikroe)
procedure LCD_OUT_CHAR(const LCD_char_No: byte; Const ch: char);
begin ... output one char in a given position.... end;
procedure LCD_OUT_WRAPPED(
const LCD_Length: integer; // how many letters in LCD
const Array_Letters: array of char; // "open array", has Low(x), High(x), Length(x) implicitly passed
const Array_shift: integer; // n-th letter of string to be put to zero-th place of LCD
);
var
i: integer;
begin
for i := 0 to LCD_Length - 1 do
LCD_OUT_CHAR( i, Array_Letters[ Low(Array_Letter) + (i + Array_shift) mod Length(Array_Letters) ]);
end;
....
var
sign : array [0..3] OF CHAR;
...
LCD_OUT_WRAPPED(12, sign, 2 );
Sleep(1000);
LCD_OUT_WRAPPED(12, sign, 3 );
Sleep(1000);
LCD_OUT_WRAPPED(12, sign, 4 );