Could really do with a Delphi "WITH" equivalent

BlitzMax Forums/BlitzMax Programming/Could really do with a Delphi "WITH" equivalent

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Sometimes I could really do with an equivalent of the Delphi With statement in Bmax. It doesn't compile to anything, it just saves lots of typing. For example:

MyHumoungousType.SomeOtherPArt.AnotherBit.X = 1
MyHumoungousType.SomeOtherPArt.AnotherBit.Y = 1
MyHumoungousType.SomeOtherPArt.AnotherBit.DoSomething()

Can be written as:
With MyHumoungousType.SomeOtherPArt.AnotherBit do
begin
  x=1
  y=1
  dosomething()
End


Yes I know in BMax I can just do:

MyAlias:TThing = MyHumoungousType.SomeOtherPArt.AnotherBit
MyAlias.x=1
MyAlias.y=1
MyAlias.DoSomething()


But that means the code actually has to create an alias an manipulate it at runtime whereas the Delphi version just change "scope" for convenience at compiletime.