DEFINT A-Z - Printable Version +- Qbasicnews.com (http://qbasicnews.com/newforum) +-- Forum: QBasic (http://qbasicnews.com/newforum/forum-4.html) +--- Forum: QB Discussion & Programming Help (http://qbasicnews.com/newforum/forum-11.html) +--- Thread: DEFINT A-Z (/thread-8342.html) |
DEFINT A-Z - phycowelder - 11-04-2005 Quick Question. ive seen it used and doent know what it does. DEFINT A-Z ^---- what does this bit of code do? i know this might be a realy stupid Question! but bear with me, LOL im only human in a digital world! DEFINT A-Z - MystikShadows - 11-04-2005 It sets the default datatype for all non declared variables. This particular instruction sets the defaul type to integer the A-Z says that variables starting with A through Z should be defaulted to the INTEGER type (-32768 to 32767). The main reason to use his is to accelerate things a bit. Somewhat of a shortcut. DEFINT A-Z - phycowelder - 11-04-2005 i see, that makes sense, thanx! DEFINT A-Z - Moneo - 11-05-2005 If your program doesn't start with a DEFINT or other DEFxxx, or you do a partial DEFINT like DEFINT A-J, then all the variables not covered will automatically default to SINGLE. ***** DEFINT A-Z - Dr_Davenstein - 11-05-2005 Sorry, but I just wanna add a bit more because this really bit me in the ass before I had the internet. If you will think about it this way, I think it will make things really clear for ya. What is the answer to, say... 2 + 2? 4, right? :lol: Well, it's only addition, right? OK, so what is the answer to, say... 2.21765493 + 2.3769153? Takes you a bit longer to figure that one out, aye? Well, it also takes the computer a while longer... not quite as long though. :lol: Like they were sayin'... DEFINT makes all of QB's variables that begin with the letters A-Z, default to the INTEGER data type , instead of SINGLE floating point. |