Thread: Variables?
View Single Post
Old 15 March 2017, 10:08   #4
Retro1234
Phone Homer
 
Retro1234's Avatar
 
Join Date: Jun 2006
Location: 5150
Posts: 5,782
Quote:
Originally Posted by Daedalus View Post
Blitz has a number of different variable types, some support floating point values (decimal points), some don't. By default variables are the "Quick" type which support decimal points, but if a variable has previously been defined as an integer type it can't be used for floats after.

You can force a variable to be whatever type you like by giving it an extension when you first define it:

a.l makes a long integer (32-bit)
a.w makes a word integer (16-bit)
a.b makes a byte integer (8-bit)
a.q makes a quick float (16-bit integer, 16-bit fractional)
a.f makes a float (32-bit)

These types reflect the standard variable types supported by the system, so you can always choose the most appropriate type for a particular use.

What other code is in your program? As idrougge suggests, if you've previously defined My_var as an integer with different capitalisation, the new version above will be a quick type, which has a decimal point.
Yes Thanks My_var.l seems to work

Is there a way I can set all variables to this without adding .l to all my variables?
Retro1234 is offline  
 
Page generated in 0.07959 seconds with 11 queries