SetDateCountry()

This forum is meant for questions and discussions about the X# language and tools
Post Reply
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am

SetDateCountry()

Post 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
User avatar
Chris
Posts: 4562
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

SetDateCountry()

Post 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
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
User avatar
robert
Posts: 4225
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

SetDateCountry()

Post 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
XSharp Development Team
The Netherlands
robert@xsharp.eu
Post Reply