Main Menu

declaring floats

Started by gingerprince, September 23, 2006, 12:55:22 AM

Previous topic - Next topic

gingerprince

If I declare a variable as a float using the # symbol

eg.  xaxis# = 0

Do I still need to use the full ` xaxis#` or can I use `xasis` after it has been initially declared as a float

cheers

kevin


Yes,  PB is multi instance.  If you drop the # it'll assume you mean the 'integer' instance, rather than the Float one


gingerprince

Thanks for the swift reply........good result for a potential new customer!

kevin


  Well, there's no rush.  Anyway,  you could enable/disable option explicit if you wanted, which will catch typed variable declarations for you.  You'll still need the postfix symbols (# and $), but if you drop one by accident, it'll spit up and error at compile time.

  It does mean you'd have to explicitly declare your variables though...

ie.

Dim MyFloat as float

or via  declaration sections, which only support int,float and strings from memory

Declaration
     MyFloat#
     MyInt
Enddeclartion

that kinda thing.