Jump to content
Sign in to follow this  
dummzeuch

can anything else but a variable be declared as 'absolute'?

Recommended Posts

I just found code in the GExperts code formatter that treats the 'absolute' keyword in the same way in variable and type declarations.

 

I know of only one way absolute can be used:

procedure Bla;
var
  Var1: array[0..4] of byte;
  Var2: integer absolute Var1;
begin
  Var2 := 5;
  Assert(Var1[0] = 5);
  Assert(Var1[1] = 0);
  Assert(Var1[2] = 0);
  Assert(Var1[3] = 0);
end;
  

Declaring Var2 in this way means that it accesses the same memory as Var1. The Embarcadero documentation agrees with me.

 

I know of no way to use 'absolute' in a type declaration.

 

Am I missing something?

Edited by dummzeuch

Share this post


Link to post

I think `absolute` is treated as a keyword only after (global/local) "variable declarator" (`identifier-list ':' type`), otherwise, it is just an identifier. 

 

 

Share this post


Link to post
Just now, Alain Weber said:

Certainly to test big or little indian code

<Images of General Custer flashing by...>

  • Haha 1

Share this post


Link to post
2 hours ago, Alain Weber said:

Certainly to test big or little indian code

I had an Indian coworker once who was a bit "vertically challenged". We called her Little Indian. 😉

 

(No, we didn't actually. But she herself did sometimes.)

Edited by dummzeuch
  • Like 1
  • Haha 1

Share this post


Link to post

Guys! Please! I'm trying to work here! Now I have to go get a roll of Kleenex to clean the coffee from my monitors and keyboard... Thank you very much.

  • Like 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×