[quote=441242:@Norman Palardy]Yeah Label isnt a “string”
Its an identifier followed by a “:”
And all of this is resolved at compile time - not runtime
So no you cannot do what you’re thinking - at least not that way 
A jump table would work though but would be very tailored to the situation
Basically a jump table might be an array of delegates that all have a common signature
[/quote]
That is Lot of setup/complication (and more overhead) than is warranted for many cases (like the one I am dealing with!
)
What I would really like is a “computed” GotTo (IIRC Fortran had something like that)… That is what I meant by the compiler being smart… essentially creating a jump table for use within the method…
Internally the compiler could create the following:
Array Labels() As String or Enums ' i doubt there would ever be so many that a dictionary would be significantly faster
Array LabelAddress() As Uint64
JumpTo LabelAddress(Labels.Indexof(LabelStringOrEnum))
Or If it was implemented as Enums only who’s integer value directly corresponded to the index of the address internally that could simplify to:
JumpTo LabelAdress( Ctype(theEnum,Integer) )
Either should be blazingly fast compared to Select Case… Also probably faster than using an array of delegates, as it avoids any overhead associated with using delegates but also potentially that of method calls…
With a Computed Goto solution one has the option of using methods when appropriate, or when an option takes only a few lines of code do it within that method to avoid that overheard…
And it would CERTAINLY be a lot less work/time to configure than the delegate solution and be more flexible … and RAD is a Xojo selling point!
It would about as much work on our end as setting up as Select Case, but a lot better performance.
That is why I thought maybe a Goto that could take a variable as the label might be a good thing.
Xojo has rep for being slow at somethings (without resorting to arcane solutions or plugins)…
But features like a the above (they would not have to call it A Computed Goto… maybe JumpToCase to avoid stigma) and being able to Freeze a MemoryBlock (and have the framework methods work directly with that instead of converting to string) could help eliminate that perception without making huge API changes that would break code.
This is lower level stuff than typical for Xojo, but done that way not THAT low, and still with reasonable safety.
Just some thoughts about what can help make Xojo be seen as a more “powerful” language (and help me do what I want to
)
(BTW I see the docs have been fixed on GoTo)
-karen