Thread: Subs parameters
View Single Post
  #13 (permalink)  
Old 01-22-2010, 03:24 PM
agraham's Avatar
agraham agraham is offline
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Yes you understand it right and yes it takes up more CPU cycles during mathematical operations compared to using strongly typed variables but that is the price you pay for the simplicity and ease of use of a weakly typed language and in most applications, even on a device, this is usually not a problem as there are other things that dominate execution time - like the user for many interactive applications.

If you really need to do intensive mathematics in Basic4ppc you can declare one or more arrays or structs as Double and use their elements for numeric calculations. As all numeric operations are done as Doubles this avoids converting to and from string values. In an optimised compiled app this will give you a good speed boost over normal string based non-array variables. To avoid the overhead of the array access for each variable fetch and use non-array variables you could use my http://www.basic4ppc.com/forum/addit...html#post28926 library.

I believe Erel intends to introduce some form of type declaration for normal variables in some future release of Basic4ppc.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote