Date issue - extremely frustrating!
Date issue - extremely frustrating!
Please try reproducing the problem in a small sample. Create a new standard Mdi app, add the same code and dbsrvers etc that cause the problem in your main app and see if the problem still happens. If it does, then please export and post the (zipped) .aef file here, so we can also give it a try and search what is causing the problem. If it doesn't happen in the small sample, then there's something else in your main app causing this and will need further debugging. But first things first!
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
Date issue - extremely frustrating!
I second what Chris said!
Simply provide a small AEF without any bells or whistles but the necessary DBF and index files that can replicate the issue.
Simply provide a small AEF without any bells or whistles but the necessary DBF and index files that can replicate the issue.
Date issue - extremely frustrating!
OK. I created a whole new "app" with just the same server and a form view. In Form view the date is fine, as it is in the Browse view i.e., its working as it should...
THEN... I went back to my real app, removed every single mention of SetInternational, SetCentury, SetDateFormat and even SetAmPm EXCEPT for in my start Method. NOW, all Form Views work as they should, but EVERY browse view(whether it be bBrowser or the VO Browser) displays the date wrongly...
The database itself, has the date value stored correctly also (dd/MM/yyyy)
Does any of that help you?
method Start() class App
local oMainWindow as TopAppWindow
Local cWorkDir as String
cWorkDir := WorkDir()
request dbfcdx
self:Initialize()
oMainWindow := TopAppWindow{self}
oMainWindow:Show(SHOWZOOMED)
oMainWindow:Caption := cAppVersion
RddSetDefault("DBFCDX")
SetExclusive(FALSE)
SetDeleted(true)
oMainWindow:Icon := BM{}
oMainWindow:IconSm := BM{}
// SetEpoch(2000)
// Set Decimals to 2
self:SetGlobalValues()
Run("FixOutlook2016.reg")
oMainWindow:EnableSystemMenu(FALSE)
SetDateFormat("dd/MM/yyyy")
SetInternational(#Clipper)
SetCentury(true)
oMainWindow:ShowMainMenu()
self:Exec()
Return self
THEN... I went back to my real app, removed every single mention of SetInternational, SetCentury, SetDateFormat and even SetAmPm EXCEPT for in my start Method. NOW, all Form Views work as they should, but EVERY browse view(whether it be bBrowser or the VO Browser) displays the date wrongly...
The database itself, has the date value stored correctly also (dd/MM/yyyy)
Does any of that help you?
method Start() class App
local oMainWindow as TopAppWindow
Local cWorkDir as String
cWorkDir := WorkDir()
request dbfcdx
self:Initialize()
oMainWindow := TopAppWindow{self}
oMainWindow:Show(SHOWZOOMED)
oMainWindow:Caption := cAppVersion
RddSetDefault("DBFCDX")
SetExclusive(FALSE)
SetDeleted(true)
oMainWindow:Icon := BM{}
oMainWindow:IconSm := BM{}
// SetEpoch(2000)
// Set Decimals to 2
self:SetGlobalValues()
Run("FixOutlook2016.reg")
oMainWindow:EnableSystemMenu(FALSE)
SetDateFormat("dd/MM/yyyy")
SetInternational(#Clipper)
SetCentury(true)
oMainWindow:ShowMainMenu()
self:Exec()
Return self
Date issue - extremely frustrating!
Since you cannot duplicate the date issue in a small sample and it works fine there, then it must be a setting in your real app!
Are you sure you checked every library or dll linked to your app?
Have you tried to do a DEBUG and trace every call being made before you display your form?
Are you sure you checked every library or dll linked to your app?
Have you tried to do a DEBUG and trace every call being made before you display your form?
Date issue - extremely frustrating!
I absolutely agree Jamal, but where?Since you cannot duplicate the date issue in a small sample and it works fine there, then it must be a setting in your real app!
I used all the same Libraries and DLL's linked in in my test app as are in my real app.... still worked fine in the test...Are you sure you checked every library or dll linked to your app?
I must confess I'm not really sure how to do that. I can use the debugger, but I can't use it all that well...Have you tried to do a DEBUG and trace every call being made before you display your form?
Date issue - extremely frustrating!
Well! You are in a big trouble <g>, but you can help yourself by reading the VO help (under Contents), look for Using the Debugger.
Excerpts:
The Debugger is the primary workspace in the IDE for tracking and correcting errors that occur at runtime. Use either the Debug Run menu command or the Trace Expression toolbar button to access the Debugger from the various browsers and editors.
The Debugger is an advanced tool for debugging an application, enabling you to:
· Control the execution of your application while viewing the source code in the Debug Source Code window
· Execute any part of your application using one of several execution modes, including a mode in which you step through the code one line at a time
· Conditionally stop program execution using breakpoints
· Monitor watch expressions in a separate window
· Evaluate expressions on-the-fly
· View and modify variables of all storage classes
· View database, index, and other work area information in a separate window
· View and modify system settings
See Also
The Debugger Workspace
Setting Debugging Options
Debug Execution Modes
Run command
Evaluating Expressions
Using Breakpoints
Using the Watch Expression Window
Viewing and Modifying Variables
Viewing Work Areas
Changing Environment Settings
Other Debugging Techniques
and finally Good Luck!
Excerpts:
The Debugger is the primary workspace in the IDE for tracking and correcting errors that occur at runtime. Use either the Debug Run menu command or the Trace Expression toolbar button to access the Debugger from the various browsers and editors.
The Debugger is an advanced tool for debugging an application, enabling you to:
· Control the execution of your application while viewing the source code in the Debug Source Code window
· Execute any part of your application using one of several execution modes, including a mode in which you step through the code one line at a time
· Conditionally stop program execution using breakpoints
· Monitor watch expressions in a separate window
· Evaluate expressions on-the-fly
· View and modify variables of all storage classes
· View database, index, and other work area information in a separate window
· View and modify system settings
See Also
The Debugger Workspace
Setting Debugging Options
Debug Execution Modes
Run command
Evaluating Expressions
Using Breakpoints
Using the Watch Expression Window
Viewing and Modifying Variables
Viewing Work Areas
Changing Environment Settings
Other Debugging Techniques
and finally Good Luck!
Date issue - extremely frustrating!
What if you copy all the Set*** calls that you currently use in your main app (in the Start() method as you mentioned) and you paste them to the Start() method of the test app, now can you reproduce the problem again in the test app's browsers? If yes, can you please export it, zip the aef and post it here?
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
-
- Posts: 774
- Joined: Wed May 17, 2017 8:50 am
- Location: Germany
Date issue - extremely frustrating!
Hi Jeff,
i´m running a german windows. i put some pieces together that show how i´m able to see british and american dates too. To setup a german #CLIPPER environment i´m using:
SetInternational ( #CLIPPER )
SetNatDll ( "GERMAN.DLL" )
SetDateFormat ( GERMAN )
If you´re running a British or American windows you don´t need to use SetNatDll() . Both languages use the default nation dll VO28nat.dll ( see cavo bin dir ) which is loaded automatically.
That´s the source code of the attached AEF:
If that doesn´t work for you i´ll jump out the window :woohoo: - promised
regards
Karl-Heinz
i´m running a german windows. i put some pieces together that show how i´m able to see british and american dates too. To setup a german #CLIPPER environment i´m using:
SetInternational ( #CLIPPER )
SetNatDll ( "GERMAN.DLL" )
SetDateFormat ( GERMAN )
If you´re running a British or American windows you don´t need to use SetNatDll() . Both languages use the default nation dll VO28nat.dll ( see cavo bin dir ) which is loaded automatically.
That´s the source code of the attached AEF:
Code: Select all
FUNCTION Start()
LOCAL cCurrentDateFormat, cLanguage AS STRING
LOCAL iLanguage AS INT
LOCAL d AS DATE
iLanguage := 1 // select the desired language - 1 or 2
SetInternational ( #CLIPPER )
DO CASE
CASE iLanguage == 1
// NOTE: the nation dll "vo28nat.dll" is automatically loaded ( see cavo bin dir )
SetDateCountry ( BRITISH ) // long date will be "17/06/2019"
cLanguage := "BRITISH"
CASE iLanguage == 2
// NOTE: the nation dll "vo28nat.dll" is automatically loaded ( see cavo bin dir )
SetDateCountry ( AMERICAN ) // long date will be "06/17/2019"
cLanguage := "AMERICAN"
ENDCASE
? cLanguage + " - used nation dll:" , GetNatDLL() // VO28NAT.DLL
?
// -------------
d := Today()
//
// save the default nation Dateformat
//
cCurrentDateFormat := GetDateFormat()
//
// Set a userdefined Dateformat
//
// The Date will always be shown in this format, no matter which DateCountry or nation dll is selected !
SetDateFormat( "YYYY_MM_DD")
SetCentury ( TRUE )
? Transform ( d , GetDateFormat () ) // must always show "2019_06_17"
? DToC ( d ) // must always show "2019_06_17"
SetCentury ( FALSE )
? Transform ( d , GetDateFormat () ) // must always show "19_06_17"
? DToC ( d ) // must always show "19_06_17"
SetCentury ( TRUE )
? Transform ( d , GetDateFormat () ) // must always show "2019_06_17"
? DToC ( d ) // must always show "2019_06_17"
SetCentury ( FALSE )
? Transform ( d , GetDateFormat () ) // must always show "19_06_17"
? DToC ( d ) // must always show "19_06_17"
?
//
// restore the default DateFormat
//
// Now, the output depends on the BRITISH or AMERICAN dateformat
//
SetDateFormat( cCurrentDateFormat)
SetCentury ( TRUE )
? Transform (d , GetDateFormat () )
? DToC ( d )
SetCentury ( FALSE )
? Transform ( d , GetDateFormat () )
? DToC ( d )
SetCentury ( TRUE )
? Transform ( d , GetDateFormat () )
? DToC ( d )
SetCentury ( FALSE )
? Transform ( d , GetDateFormat () )
? DToC ( d )
?
_Wait()
RETURN NIL
regards
Karl-Heinz
- Attachments
-
- DateFormat.ZIP
- (1.18 KiB) Downloaded 40 times
Date issue - extremely frustrating!
Thanks so much Karl-Heinz. How are you with heights? Of course your app worked beautifully, but unfortunately my app still behaves incorrectly....
ALL browsers are totally disregarding Set... directives. The forms are OK, the Browse Views are not
ALL browsers are totally disregarding Set... directives. The forms are OK, the Browse Views are not
Date issue - extremely frustrating!
FOUND IT!!!!!
This one line caused ALL this:
SetInternational(#Clipper)
Took it out, everything works as it should. Thank you all very very much for your assistance.... again :/
This one line caused ALL this:
SetInternational(#Clipper)
Took it out, everything works as it should. Thank you all very very much for your assistance.... again :/