var instead of const

General discussion on mikroPascal PRO for AVR.
Post Reply
Author
Message
corado
Posts: 399
Joined: 28 Mar 2009 11:03

var instead of const

#1 Post by corado » 30 Oct 2023 21:52

If i try this

Code: Select all

Function LED_Blink(const i : Word):BYTE;
Begin
  Led_Status := not Led_Status;
  delay_ms(i);
  result:=0;
end;
I got the message
"45 304 Syntax error: Expected "constant expression" but "complex expression" found RTC_DS3234.mpas
45 305 Argument is out of range "i. Argument must be greater than or equal to 0." RTC_DS3234.mpas


Delay is waiting for an constand, but I want to use a variable.
How can I do that?

Thomas.Pahl@t-online.de
Posts: 158
Joined: 24 May 2008 15:55
Location: Germany

Re: var instead of const

#2 Post by Thomas.Pahl@t-online.de » 02 Nov 2023 11:11

use Vdelay_ms() instead

Post Reply

Return to “mikroPascal PRO for AVR General”