B4J Question B4j 7.32 Map error

prajinpraveen

Member
Licensed User
7.32 does not like map.put(key:value) forces to change to map.put(key,value)
is there any work around. I have hundreds of maps in the project.
 

DonManfred

Expert
Licensed User
7.32 does not like map.put(key:value) forces to change to map.put(key,value)
is there any work around. I have hundreds of maps in the project.
How do you think it is not supported?

Using the Map Object you always have to use key comma value. Even in the past.

The : is ONLY available in the CreateMap command.
 

prajinpraveen

Member
Licensed User
You are correct @DonManfred . i have used map like this, my mistake. V 7.31 didnt complain about this.

B4X:
Dim temp As Map
temp.Initialize
temp.Put("test":"value")
Log(temp)
 

Erel

Administrator
Staff member
Licensed User
It was actually a bug in previous versions that allowed this syntax.

However you should really use CreateMap:
B4X:
Dim temp As Map = CreateMap("test": "value")
 

Didier9

Active Member
Licensed User
[..]I have hundreds of maps in the project.
When I have large source files to edit for syntax changes similar to what you are facing, I like to use TextPad, a text editor that has powerful search and replace feature using regular expressions.
I import the source code into Textpad, revise it and copy it back into the IDE.
I believe there is a free demo version of Textpad. I personally bought it because I use it a lot (I make no money off it, I am just a happy customer.)
 
Top