Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why define constants
Message
From
25/10/2006 13:59:51
 
 
To
25/10/2006 13:55:22
Alexandre Palma
Harms Software, Inc.
Alverca, Portugal
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01164235
Message ID:
01164484
Views:
8
What brought you back to the UT afer 3 years? :0)


>>>I see two problems with your alternative: 1) memvar consumption and 2) runtime execution speed.
>>
>>1. Actually it might bite you as well. E.g:
>>
#DEFINE MYSTRING "This is a very long string of a few hundred characters long ....."
>>
>>IF you use this instead of a variable, it ends up as many times you use the contant, consuming more memory than when using variables.
>
>I'm sorry Walter but you are 100% wrong on this one.
>The #DEFINE gets replaced when you compile your app and not at run time so in runtime.
>
>>
>>2. As for runtime execution speed. I don't think that anyone would take that seriously for only a very few performance critical routines. You can of course prove the difference, but how many value has this have in practise, while about every VFP programmer has difficulty to get their database performance over the network under control.
>>
>>Walter,
>>
>>
>>
>>
>>
>>
>>
>>>>I would too. But I don't see a problem with:
wdUndefined     = 9999999
>>>>wdToggle       = 9999998
>>>>wdForward      = 1073741823
>>>>wdBackward     =  -1073741823
>>>>wdAutoPosition = 0
>>>>wdFirst        = 1
>>>>wdCreatorCode  =  1297307460
>>>>You touch on a problem with .h files. And they also have to be explicitly 'set' (managed). I just don't see a whole lot of value with #DEFINE.
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform