fbpx

SetDateCountry()

  • Karl-Heinz Rauscher
  • Karl-Heinz Rauscher's Avatar Topic Author
  • Offline
More
1 month 2 weeks ago #1 by Karl-Heinz Rauscher
SetDateCountry() was created by Karl-Heinz Rauscher
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 ?

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:

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

Please Log in or Create an account to join the conversation.

More
1 month 2 weeks ago #2 by Chris Pyrgas
Replied by Chris Pyrgas on topic SetDateCountry()
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

XSharp Development Team
chris(at)xsharp.eu

Please Log in or Create an account to join the conversation.

More
1 month 1 week ago #3 by Robert van der Hulst
Replied by Robert van der Hulst on topic SetDateCountry()
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 github.com/X-Sharp/XSharpPublic/blob/mas...re/State/EnumSet.prg
Thanks for the suggestion.

Robert

XSharp Development Team
The Netherlands
This email address is being protected from spambots. You need JavaScript enabled to view it.

Please Log in or Create an account to join the conversation.