Quantcast
Channel: Xojo Programming Forum - Latest topics
Viewing all articles
Browse latest Browse all 3833

Switch to something like “Blocks”?

$
0
0

I have a method that frequently calls a long switch statement and then performs a few lines of code. (Any entry in the switch could be called at any time, so it doesn’t make sense to order them by popularity.)

If I were using another language, like Objective-C, I’d create code blocks, assign them to a dictionary, and retrieve them with a key to find and perform the right bit of code very quickly.

What is a similar strategy in XOJO? It seems the closest solution would be to use a Dictionary, but the values would have to be the AddressOf of methods. I’d rather not have a lot of sub-method calls or the overhead of maintaining a lot of method entries. Have I missed an alternate solution? Is there something coming on the XOJO roadmap?

John

10 posts - 5 participants

Read full topic


Viewing all articles
Browse latest Browse all 3833

Trending Articles