Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Constant declaration
Tue, Jan 21 2014 1:41 AMPermanent Link

Uli Becker

This declaration fails with the error message:
[Error] Main.wbs (1095,4): Expected : but instead found Offset

procedure TMainForm.MyProcedure;
var
   i: integer;
const
   Offset = 20;
begin
....
end;

Are constant declarations not allowed within a procedure?

Thanks Uli
Tue, Jan 21 2014 9:47 AMPermanent Link

Raul

Team Elevate Team Elevate

Good find - i'm seeing the same.

I know I've used constants before but checking back they were all at the
unit level (i.e. after implementation keyword ).

Also not seeing anything in help saying you can't have them at function
level so need Tim to comment

Raul

On 1/21/2014 1:41 AM, Uli Becker wrote:
> This declaration fails with the error message:
> [Error] Main.wbs (1095,4): Expected : but instead found Offset
>
> procedure TMainForm.MyProcedure;
> var
>     i: integer;
> const
>     Offset = 20;
> begin
> ...
> end;
>
> Are constant declarations not allowed within a procedure?
>
> Thanks Uli
>
Tue, Jan 21 2014 2:50 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Uli,

<< Are constant declarations not allowed within a procedure? >>

No.

Tim Young
Elevate Software
www.elevatesoft.com
Image