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

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

Beta Versions This forum is the place to discuss issues regarding Basic4ppc beta versions.

Variable type conversion

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-26-2010, 07:24 PM
klaus's Avatar
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Fully, Switzerland
Posts: 3,827
Awards Showcase
Forum Contributer Beta Tester Competition Winner 
Total Awards: 3
Default Variable type conversion

Will there be variable type conversion functions ?
Like
CInt to convert any type to an Integer
CDbl to convert any type to a Number (Double)
CStr to convert any type to a String

Or is the conversion done automatically by B4PPC ?

Best regards.
__________________
Klaus
Switzerland
Reply With Quote
  #2 (permalink)  
Old 02-26-2010, 07:43 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

It is done automatically if you assign the contents of one typed variable to another differently typed variable. You will get an exception if the conversion can't be done.

Dim S
Dim I As Integer
Dim N As Number

N = 1.234 ' contents are a Double value 1.234
S = N ' contents are a string "1.234"
I = S ' contents are rounded/truncated to an Int32 value of 1
__________________
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-26-2010, 07:48 PM
klaus's Avatar
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Fully, Switzerland
Posts: 3,827
Awards Showcase
Forum Contributer Beta Tester Competition Winner 
Total Awards: 3
Default

Thank you Andrew.

Best regards.
__________________
Klaus
Switzerland
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
What variable type to declare klaus Beta Versions 2 02-26-2010 03:13 PM
Local variable cannot hid global variable jschuchert Questions (Windows Mobile) 6 10-30-2009 03:58 PM
Meldung: Local variable cannot hide a global variable JOTHA German Forum 2 07-18-2009 12:34 PM
Leading zero(s) for numeric or string type variable not saved in database. mozaharul Questions (Windows Mobile) 1 10-26-2008 05:18 PM
GPS and Conversion forisco Questions (Windows Mobile) 6 11-13-2007 10:29 PM


All times are GMT. The time now is 01:03 AM.


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