Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Session Environment Settings
Message
From
30/07/1998 11:14:04
Bob Lucas
The WordWare Agency
Alberta, Canada
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Title:
Session Environment Settings
Miscellaneous
Thread ID:
00122698
Message ID:
00122698
Views:
53
Hi Kevin;

First of all, thanks for the changes to the local session environment. This is a much better model. Last night I was working on verifying Y2K compliance with an app I wrote a couple of years ago and have now updated my old codebook framework. I added a century setting to the preference form, stored it in the registry and used the global application environment object (the new one) to retrieve and set for sessions. This worked great. One thing I have discovered is that the century rollover setting is not taking. By default, rollover is set to 0. In the session objects it is set to 80 and in my own global object it is set to 90 (what the heck, eh?). Here is the code in question:

IF NOT EMPTY(This.nCentury) AND ;
NOT EMPTY(This.nRollover)
IF This.lSetDefaults
SET CENTURY TO (This.nCentury) ;
ROLLOVER (This.nRollover)
ENDIF
ENDIF

this.lSetDefaults is set to .f. (In fact, you could even make a case for removing the form session object entirely because I don't think I would ever change the settings, but that is minor.) The century and rollover code never execute. I changed my code to the following:

IF NOT EMPTY(This.nCentury) AND ;
NOT EMPTY(This.nRollover)
IF This.lSetDefaults
SET CENTURY TO (This.nCentury) ;
ROLLOVER (This.nRollover)
ELSE
SET CENTURY TO (This.nCentury) ;
ROLLOVER (This.nRollover)
ENDIF
ENDIF

A bit of a kludge but it did accomplish the task. The alternative is to remove default values for nCentury and nRollover in csessionenvironment and make sure they are set in the cglobalenvironment.osessionenvironment object. At any rate, a line of code should execute from the call to goApp.oEnvironment.oSessionEnvironment.Set(...) to make the setting, whether or not it gets overriden by a subsequent call to the forms session set method. My really quick change allows the SET CENTURY TO command to be issued although the way I have it, I can't make application level changes to the settings (not that I really need to though because the defaults are fine.

Anyway, something you might want to look into as the year 2000 approaches.

One interesting thing I found, when I enter 00 as the year (rollover at 80) it automatically displays 2000 even if century is set off. I guess if the century of the date is different from the century set by set century to then the full date will display no matter whether century is on or off. Neat!
Reply
Map
View

Click here to load this message in the networking platform