Android Question Step through "Type" variables?

TheMightySwe

Active Member
Licensed User
Longtime User
Is there any way to step through a "Type" like the one below in some kind of loop?

B4X:
Type SQLTypes (BlobType As Int, DateTimeType As Int, StringType As Int, DoubleType As Int, IntType As Int, BooleanType As Int)
 

TheMightySwe

Active Member
Licensed User
Longtime User
OK, oh my!

That might work, but with a huge problem.

My Type has almost a thousand Integers and changes alot when new functions are added. Is there any way to step through it to get the Variable names?

If not, i just do it the hard way.

// TMS
 
Upvote 0

TheMightySwe

Active Member
Licensed User
Longtime User
I want to use the Names from the type instances for a map that saves if a user has or hasn't access to the function that corresponds with the type instance.
 
Upvote 0

Troberg

Well-Known Member
Licensed User
Longtime User
Maybe you should take a step back and reconsider using a type and think about using some other construct instead? Class, map, array, list, database are all viable alternatives, depending a bit on your specific needs.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
I want to use the Names from the type instances for a map that saves if a user has or hasn't access to the function that corresponds with the type instance.
Use KeyValueStore (or RandomAccessFile.WriteB4XObject). It allows you to save a type instance or any collection that holds other types in a single line of code.
 
Upvote 0

TheMightySwe

Active Member
Licensed User
Longtime User
The thing is i can't change this because its embedded in thousands of places in a huge project, if it's not possible to get the variables names out, I will fix another solution ofcourse. But it does not hurt to ask.
 
Upvote 0

Troberg

Well-Known Member
Licensed User
Longtime User
I don't know the project, but, in my experience, don't underestimate the power of search and replace, and simple find and manual correct.

I'd make a copy of the project, and then start doing the change, just to get a feel for how big it really is. Usually, when I fear a big rewrite, it's much less work than I thought.
 
Upvote 0
Top