Wish Typed maps and lists

Troberg

Well-Known Member
Licensed User
Just like arrays, it would be nice to (optionally) be able to limit what you can stuff into a map or list.

Something like:

B4X:
Dim Songs as Map of cMediaFiles
Dim Events as List of cCalendarEvents
Then, if I tried to stuff, say, a filename in a string into the Songs map, the compiler would give an error.

This syntax, of course, should be optional.

Not only would it stop some unnecessary bugs, it would also make the code clearer by clearly stating "I intend this list to hold objects of this type!".
 
Top