Feature Request: Scope..End Scope

BlitzMax Forums/BlitzMax Programming/Feature Request: Scope..End Scope

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.

Actually, Noel (not to hijack your thread)...

But a similar implementation to what you mentioned above would be most useful if it were applied to an object:

Scope SomeObject:TList = new TList
   Local P:PlayerSprite = New PlayerSprite
   SomeObject.AddLast P
End Scope


Basically it would keep SomeObject alive for the duration of the Scope block.

This would act similarly to the "using" syntax of C# and (I think, Java).

The gain here would presumably be the same gain that you would get with other languages such that it provides a clear definition to BlitzMax of a particular object's life without the overhead of reference counts for the purposes of garbage collection.

Anyway.. just an idea.