xsharp.eu • SetDateCountry()
Page 1 of 1

SetDateCountry()

Posted: Sat Dec 08, 2018 1:12 pm
by Karl-Heinz
Hi Chris,

VO uses some not well chosen country define names. Maybe that´s the reason why these defines are not part of the x# runtime ?

Code: Select all

DEFINE ANSI    := 2  // yy.mm.dd  yyyy.mm.dd
DEFINE AMERICAN := 1 // mm/dd/yy  mm/dd/yyyy
DEFINE BRITISH := 3  // dd/mm/yy  dd/mm/yyyy
DEFINE FRENCH  := 4  // dd/mm/yy  dd/mm/yyyy
DEFINE GERMAN  := 5  // dd.mm.yy  dd.mm.yyyy
DEFINE ITALIAN := 6  // dd-mm-yy  dd-mm-yyyy
DEFINE JAPANESE := 7 // yy/mm/dd  yyyy/mm/dd
DEFINE USA     := 8  // mm-dd-yy  mm-dd-yyyy    
How about a SetDateCountry() enum overload ? Something like:

Code: Select all

public enum DateCountry
	member American := 1
	member Ansi    := 2
	member British := 3
	member French := 4
	member German := 5
	member Italian := 6
	member Japanese := 7
	member USA := 8
end enum

FUNCTION SetDateCountry( enumCountry AS DateCountry ) AS DWord 
RETURN SetDateCountry( (DWORD) enumCountry )

What do you think ?

regards
Karl-Heinz

SetDateCountry()

Posted: Sat Dec 08, 2018 2:29 pm
by Chris
Hi Karl-Heinz,

I think those DEFINEs were simply forgotten. Yeah, using an ENUM is much nicer, only problem is that for existing code to compile, we need to support the DEFINEs...

Chris

SetDateCountry()

Posted: Sun Dec 09, 2018 11:31 am
by robert
Karl-Heinz ,
We will add the defines and the enum. We can also add the overload that takes an enum as well.
We will map the defines to the enum members to make sure that they have the same value. Just like what we have done for the various SET defines, like you can see in https://github.com/X-Sharp/XSharpPublic ... numSet.prg
Thanks for the suggestion.

Robert