Map with integer key
- Thorsten1867
- Addict
- Posts: 1366
- Joined: Wed Aug 24, 2005 4:02 pm
- Location: Germany
Map with integer key
It would be very helpful if there were also a MAP where you could use integers as keys.
Translated with http://www.DeepL.com/Translator
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
-
- Addict
- Posts: 4519
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
Re: Map with integer key
Very, very, very, very, very....... helpfulThorsten1867 wrote:It would be very helpful if there were also a MAP where you could use integers as keys.
+1
- Andre
- PureBasic Team
- Posts: 2056
- Joined: Fri Apr 25, 2003 6:14 pm
- Location: Germany (Saxony, Deutscheinsiedel)
- Contact:
Re: Map with integer key
+1
Currently I'm using maps most of the time with unique ID numbers as map key.
But always need to convert them to ID strings first, which could be avoided if this wish come true
Currently I'm using maps most of the time with unique ID numbers as map key.
But always need to convert them to ID strings first, which could be avoided if this wish come true
Re: Map with integer key
+ 1
How about:
How about:
Code: Select all
;Create a map based on #PB Type:
NewMap Country.s(#PB_Integer)
NewMap Country.s(#PB_Float)
NewMap Country.s(#PB_Byte)
NewMap Country.s(#PB_Double)
;...
;-> MapType() -> returns the Type
Re: Map with integer key
Or:
Code: Select all
;Create a map of either String or Integer type, #PB_Default used for slots = 512 and for type = #PB_String
NewMap name.<type>([Slots | #PB_Default [, #PB_String | #PB_Integer | #PB_Default]])
MapType(Map()) -> returns either #PB_String or #PB_Integer
Re: Map with integer key
I think you are asking for something like this, to use in the meantime:
viewtopic.php?f=13&t=58708
viewtopic.php?f=13&t=58708
Re: Map with integer key
+1
Any official statement?
Any official statement?
Re: Map with integer key
no but you can use the numeric functions of squint for that.
viewtopic.php?f=12&t=75783
viewtopic.php?f=12&t=75783
Re: Map with integer key
I, too, would like this feature... However...
Consider their focus at the moment: it's fully on the alpha release. My bet is that if you do get a reply, it will be something like "we may evaluate new features after the C backend is released".
It's not really reasonable to think they are going to put the alpha release on hold to add a feature request that is two years old... Especially when there are at least two libraries on the forum that do what you have asked for.
Has Fred written in any threads not related to the alpha this month?