map read key problem

Cor

Active Member
Licensed User
Longtime User
If key begins with space then space is automatically stripped off

see key 024

Now i have to put dummy char at begin and strip it off when reading key

Is this a feature of map?


B4X:
dim lickmap as map
dim str1 as string

bluesv1.dat contains
024=    0   0 2p0       4   4   2p058
025=-   0   0 2p0       4   4   2p058

lickMap=File.readmap(File.dirassets,"bluesv1.dat")

str1=lickMap.Get("024")

tabCanvas.DrawText(str1,18dip,48,tabFont,20,Colors.Blue,"LEFT")
 

Cor

Active Member
Licensed User
Longtime User
Don't create txt with map.put

Just create with editor and save it as utf-8
then use only readmap

attached is a utf-8 text file
 

Attachments

  • bluesv1.txt
    708 bytes · Views: 267
Last edited:
Upvote 0

Cor

Active Member
Licensed User
Longtime User
after done several tests, map is unuseable for loading tab notation style

\ = slide
and space are stripped off

I will find for another solution to read the text files

like below

B4X:
02u=              |2
021=                                
022=                                  
023=                      0   0     
024=/    0   0 2p0      4   4   2p0
025= 0h3   3       3 /5            
026=\3p2                                    
02d=     d u   d   u     u d u d
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
Hi Cor,

Not sure if this will help, but you could use an arbitrary character at the beginning of each row and strip it out on reading. Also you would have to change the keys of the non strings to sort in the correct order if that's important. I attach an example.

steve
 

Attachments

  • ta4.zip
    5.8 KB · Views: 208
Last edited:
Upvote 0

Cor

Active Member
Licensed User
Longtime User
Hello Steve,

Yes, i use that now,

I use now . at the beginning and replace after reading the map
e.g s to /

and do a replace in my code

B4X:
02u=.             |2
021=.                               
022=.                                     
023=.                     0   0     
024=.    01  0 2p0      4   4   2p0*
025=.0h3   3       3 /5            
026=.s3p2                                    
02d=.    d u   d   u     u d u d
 
Upvote 0
Top