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.

I don't tink having with is a good idea, not only becouse it makes code more difficult to read, but also becouse it could introduce scope 'visual' confusion

Example:
SuperStrict
For Local X:int = 0 to 10
   Local I:Int = 8
   Print I
Next
Print I
This code generates a compilation bug, becouse the I variable outside the For block is out of scope (remember block-scoping on SuperStrict)

SuperStrict
With Somethig.MethodReturiningType1.FieldType
   .Property = "Hello"
   Local I:Int = 8
   Print I
End With
Print I


this code would compile, confusing the real scope of the I variable. I mean, it is a code block not really scope-oriented so it will not follow any other code block rules on BlitzMax, and I think this is not a good idea. Otherwise, making this with block a real scope will be absurd as it is not controlling any program flow or logic.