Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Data Type Declaration
Hi,
Do you choose the data type you will declare at the beginning of a macro based on what range you know your values will be between? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Data Type Declaration
I generally declare my data types based on how I expect the code to execute
and to get the results I need. "R Tanner" wrote: Hi, Do you choose the data type you will declare at the beginning of a macro based on what range you know your values will be between? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Data Type Declaration
I use the most strict datatype that the values could possibly be for the
life of the program. My approach is realist-pessimist. What do the project requirements need, but also what is the most far reaching possibility that can occur as the client/project/data grows? It works quite well for me. Overly-optimistic rules are the kiss of death of a program's functionality, dooming a solution to a lifetime of support, IMO. (E.g. "We'll never have more than 10,000 rows of data, so just use a short Int"). -- Tim Zych www.higherdata.com Compare data in worksheets and find differences with Workbook Compare A free, powerful, flexible Excel utility "R Tanner" wrote in message ... Hi, Do you choose the data type you will declare at the beginning of a macro based on what range you know your values will be between? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Data Type Declaration
For numbers???
I use "As Long", never "As Integer". I use "As Double", never "As Single". No matter how small/large they may be. R Tanner wrote: Hi, Do you choose the data type you will declare at the beginning of a macro based on what range you know your values will be between? -- Dave Peterson |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Data Type Declaration
How about As Byte?
I understand there is no point in using Integer instead of Long as Long is faster (but maybe not measurable) than Integer plus there is less chance of an overflow error. RBS "Dave Peterson" wrote in message ... For numbers??? I use "As Long", never "As Integer". I use "As Double", never "As Single". No matter how small/large they may be. R Tanner wrote: Hi, Do you choose the data type you will declare at the beginning of a macro based on what range you know your values will be between? -- Dave Peterson |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Data Type Declaration
Just so we are all on the same page... 16bit variables such as integers lose
their benefits since the systems all 32bit. There is actually extra overhead to deal with an integer over a long... so long is more efficient. -- HTH... Jim Thomlinson "Dave Peterson" wrote: For numbers??? I use "As Long", never "As Integer". I use "As Double", never "As Single". No matter how small/large they may be. R Tanner wrote: Hi, Do you choose the data type you will declare at the beginning of a macro based on what range you know your values will be between? -- Dave Peterson |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Data Type Declaration
I don't recall ever using "As Byte" either.
RB Smissaert wrote: How about As Byte? I understand there is no point in using Integer instead of Long as Long is faster (but maybe not measurable) than Integer plus there is less chance of an overflow error. RBS "Dave Peterson" wrote in message ... For numbers??? I use "As Long", never "As Integer". I use "As Double", never "As Single". No matter how small/large they may be. R Tanner wrote: Hi, Do you choose the data type you will declare at the beginning of a macro based on what range you know your values will be between? -- Dave Peterson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Use of Public for data declaration in Excel 2000 | Excel Programming | |||
type declaration characters | Excel Discussion (Misc queries) | |||
type declaration characters | Excel Discussion (Misc queries) | |||
if declaration | Excel Programming | |||
Declaration? | Excel Programming |