Android Question Step through "Type" variables?

TheMightySwe

Active Member
Licensed 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
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
 

TheMightySwe

Active Member
Licensed 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.
 

Troberg

Well-Known Member
Licensed 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.
 

Erel

Administrator
Staff member
Licensed 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.
 

TheMightySwe

Active Member
Licensed 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.
 

Troberg

Well-Known Member
Licensed 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.
 
Top