In someone elses code, I see the following:
VB Code:
variablename = 1# ' and variablename2 = 1!
What is the difference and what do they mean?
Printable View
In someone elses code, I see the following:
VB Code:
variablename = 1# ' and variablename2 = 1!
What is the difference and what do they mean?
The "!" after a variable name designates the variable as a single data type, and the # donates that the variable is a double data type :)
Those two are used in operations that involve a large ammount of decimal places, say accurate calculations :)
You can get the full reference of these here, including what they are :)
http://www.thevbprogrammer.com/index...pter=2&Topic=2
Cheers,
RyanJ
But they still basically equate to 1, correct? I'm converting a VBA app to PHP and I'm trying rule out problems in a calculation I'm having problems with.
Quote:
Originally Posted by ober0330
Well, those should only be nessisary if you need to do accurate floating point calculations, otherwise you should be fine with Integer or Long :)
Cheers and good luck with your project,
RyanJ
A VB Single data type is a 4 byte floating point number
A VB Double data type is a 8 byte floating point number
So, when you go to declare those variables in PHP, they may have to be declared with the PHP equivalents in order for the calculation to work.
Ok, that's what I thought. Thanks. And weird to see you around Hack... I thought you had gone away forever (but then again, I haven't been here in months).
Good to see you back to ober (I was away for about a year actually. :) )Quote:
Originally Posted by ober0330
I wouldn't say I'm really "back"... I'm not doing a whole lot of VB lately... I'm trying to get 75% of my company's apps on the web.
Anyways, hopefully I'll see you around.