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

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Basic4ppc Wishlist > Bug Reports
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Bug Reports Post about errors or bugs encountered.

Evaluation Bug

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-19-2011, 07:19 PM
RacingDog's Avatar
Senior Member
 
Join Date: Apr 2009
Location: Fleet, Hants, UK
Posts: 183
Send a message via Yahoo to RacingDog
Default Evaluation Bug

If Value is a mesage box then

If Value.Text = 0 Then

works if the text is "0" but not if it is "0.00"

Allegedly we are supposed to be able to rely on internal type conversions. This is clearly not the case at the moment.

When will this fundamental bug be fixed?
__________________
Racing Dog's Kennel - to get my B4PPC efforts and my other freebie proggies,
and find out a bit about me.
Reply With Quote
  #2 (permalink)  
Old 07-20-2011, 06:28 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,701
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

This is the way it is designed to behave. When you compare a string with another value for equality it converts the value to string. The other option which is to implicitly convert the string to a number will throw an exception if the string is not a number.
You will need to explicitly convert the string to number:
Code:
    Dim s As String
s = 
"0.00"
Dim n As Number
n = s 
'explicitly convert the string to number
If n = 0 Then Msgbox(True)
Reply With Quote
  #3 (permalink)  
Old 07-20-2011, 10:43 AM
RacingDog's Avatar
Senior Member
 
Join Date: Apr 2009
Location: Fleet, Hants, UK
Posts: 183
Send a message via Yahoo to RacingDog
Default

Yes that's what I did eventually. But the numbers 0 and 0.00 should be interchangeable if the concept of automatic type changes is to be followed consistently. I don't see why converting a string and getting an exception is the run time designer's concern. That is the user's mistake and he should expect to have to handle it himself with an exception handler. Protecting the user from himself is laudable in itself, but you can over do it.
__________________
Racing Dog's Kennel - to get my B4PPC efforts and my other freebie proggies,
and find out a bit about me.
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
Prepare evaluation version without crippling it. jschuchert Basic4android Updates and Questions 0 06-07-2011 07:35 PM
Boolean evaluation jerryb Basic4ppc Wishlist 3 05-20-2011 10:11 PM
A sample for arithmetical expression evaluation coldraymagic Share Your Creations 4 01-22-2009 06:58 AM
Sub name evaluation Cableguy Questions (Windows Mobile) 4 09-30-2008 09:52 AM


All times are GMT. The time now is 02:58 PM.


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