49
Can we get an option to initialize variables to a certain value?

Something like this:

var
MyInt: Integer = 10;
MyGuid: Guid = {cbbd84dc-84f8-4ca4-88dc-9a526dbf88d0};
Category: Development
STATUS DETAILS
New

Comments

A

I would like to see inline declaration of variables rather than the VAR section (ala C# et al)

Category: Development

A

Or similar to how labels are locked:

var
MyGuid: label '{cbbd84dc-84f8-4ca4-88dc-9a526dbf88d0}', Locked = true; // This is possible already! Better than a procedure that exists this Guid, but
MyGuid: Guid '{cbbd84dc-84f8-4ca4-88dc-9a526dbf88d0}', Locked = true; // would be more consistent
MyInt: Integer 10, Locked = true; // (the same for an integer)

Category: Development

A

Wish I could vote for this one more than once!
Would also agree about the constant idea (with associated codecop rules)

Category: Development

A

Optionally add the option to make the variable constant. Like:

var
MyInt: Integer = 10;
const MyGuid: Guid = {cbbd84dc-84f8-4ca4-88dc-9a526dbf88d0};

or

var
MyInt: Integer = 10;

const
MyGuid: Guid = {cbbd84dc-84f8-4ca4-88dc-9a526dbf88d0};

Category: Development