Click or drag to resize

SetDateCountry Function (DWord)

X#
Return and optionally change the setting that determines the X# date format by selecting from a list of constants with corresponding date formats.

Namespace:  XSharp.Core
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.19
Syntax
 FUNCTION SetDateCountry(
	dwNewSetting AS DWORD
) AS DWORD
Request Example View Source

Parameters

dwNewSetting
Type: DWord
One of the following constants which initializes the corresponding date format (the number of characters in the year value is control by SetCentury()):

Return Value

Type: DWord
If dwNewSetting is not specified, SetDateCountry() returns one of the numeric values described above indicating the current date and country setting.
If dwNewSetting is specified, the previous setting is returned.
Remarks
Examples
This example uses SetDateCountry() to display today's date in all 16 formats:
X#
 1FUNCTION Start()
 2    LOCAL I AS INT
 3    SetDateCountry(2)
 4    SetCentury(FALSE)
 5    ? DTOC(TODAY())
 6    ? DTOC(92.12.31)
 7    ? DTOC(1992.12.31)
 8    FOR I := 1 UPTO 8
 9        SetDateCountry(I)
10        ? I, DTOC(TODAY()), "!" + DTOC(0) + "!"
11    NEXT
12    ?
13    SetCentury(TRUE)
14    FOR I := 1 UPTO 8
15        SetDateCountry(I)
16        ? I, DTOC(TODAY()), "!" + DTOC(0) + "!"
17    NEXT
See Also