Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why define constants
Message
From
25/10/2006 13:55:22
Alexandre Palma
Harms Software, Inc.
Alverca, Portugal
 
 
To
25/10/2006 13:46:35
Walter Meester
HoogkarspelNetherlands
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01164235
Message ID:
01164482
Views:
12
>>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.
Alexandre Palma
Senior Application Architect
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform