Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4android > Bugs & wishlist
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Bugs & wishlist The place to discuss bugs and missing features.

Map returns null or "null"?

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-03-2012, 11:23 PM
Basic4ppc Expert
 
Join Date: Jun 2011
Location: Hertfordshire, UK
Posts: 1,126
Send a message via Yahoo to thedesolatesoul
Default Map returns null or "null"?

Hi,
I dont really know if this is a bug or not.
But if I use a key that does not exist with a map it returns a "null" instead of the generic Null.

Code:
Dim imgFile As String 
imgFile = MimeTypeMap.Get(db.GetFileExt(sft.FilePath))
If imgFile= Null OR imgFile = "null"  Then
    imgFile = MimeTypeMap.Get(
"default")
End If
Reply With Quote
  #2 (permalink)  
Old 02-04-2012, 08:40 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Actually it does return null as you can see here
Code:
Dim m As Map
    m.Initialize
    
Dim s, t As String
    
Dim o As Object
    o = m.Get(
"bill")
    
If o = Null Then
         t = 
"null"
    
Else
         t  = 
"not null"
     
End If    
    s = m.Get(
"fred")
    
Msgbox(s & CRLF & t,"")
The java is

Code:
 //BA.debugLineNum = 19;BA.debugLine="s = m.Get(\"fred\")";
_s = 
String.valueOf(_m.Get((Object)("fred")));
The Java static valueOf method is documented to return "null" if given a null. I don't know why Erel chose valueOf for string conversions instead of toString.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #3 (permalink)  
Old 02-04-2012, 10:15 AM
Basic4ppc Expert
 
Join Date: Jun 2011
Location: Hertfordshire, UK
Posts: 1,126
Send a message via Yahoo to thedesolatesoul
Default

I did suspect it would be a conversion issue.
Well, its nothing of much concern. Just wanted to flag the issue.
Thanks Andrew.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Wie Datenübergabe von "Main" zu "Activity2"? Watchkido1 German Forum 7 01-15-2012 12:21 PM
VisualBasic "Inputbox" zu B4A "InputDialog" wandeln Watchkido German Forum 1 09-04-2011 06:52 PM
Catching the "Shift", "right" & "left" keys linum Questions (Windows Mobile) 3 08-21-2009 01:22 PM
calling the device's "Programs" or "settings" screens karmba_a Questions (Windows Mobile) 3 03-15-2009 05:41 PM
calling the device's "Programs" or "settings" screens HarleyM Questions (Windows Mobile) 0 12-05-2007 02:59 AM


All times are GMT. The time now is 04:27 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0