[Gambas-user] RE: Re: RE: A Beginner's Guide to Gambas (2)

John Rittinghouse jr at ...1090...
Sat Oct 15 14:12:29 CEST 2005


Charlie,

If you read carefully, you will find that whole section is devoted to
how a programmer can convert from one data type to another.  That is the
WHY and it IS the point of the whole section entitled "Converting Data
Types" and even beginners need to know how to convert from one data type
to another.   The particular section you refer to explains when and why
a programmer would use VAL to convert dates and the return value of VAL
is required to be a string data type.  The code in that section shows
one how converting from one data type to another will produce the same
results for the same data (the current time) for the various data types
shown.  Otherwise, the conversion would not be correct.  I hope this
helps clear it up.


regards,
jr
  


From: Charlie Reinl <na2492 at ...1168...>
 Re: RE: A Beginner's Guide to Gambas (2)   
2005-10-14 14:21 	

 >Thanks Charlie.  Obviously, sStringLength on page 125 should be 
 >iStringLength but sDateTime is a string var used to catch the return 
 >value from the VAL call, as indicated in the code on page 143.  
  
 But for a beginner that will not be logic, that I mean. 
  
 he will think around why he change a date to a String, makes a Number 
 (val) and then he store that number in an String variable ????????? 
   
 > 
 >The font size on those two places you mentioned was reduced to make
the 
 >code fit on a single line - it was a deliberate change and you may
find 
 >that it occurs in a couple of other places as well.  Regarding the 
 >sample code errors in your previous mail, you are correct that it is
not 
 >bulletproof. I will leave that to the readers to correct as I was
trying 
 >to demonstrate how to use Gambas more than I was trying to teach good 
 >coding skills (something we could probably all take a refresher on) 
 ><grin>.  You will find, if you read the chapter on errors, that I do 
 >cover the topic of making your code more robust.  Keep sending your 
 >feedback - it is all welcome! 
 > 
 >regards, 
 >jr 
 > 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20051015/28b0cc4f/attachment.html>


More information about the User mailing list