[Migrated content. Thread originally posted on 13 April 2010]
I'm trying to grab the Short date format from the api windows XP Pro (in windows you can get to this thru control panel - regional and language settings - Customize - Date).Can anyone see what's wrong with this code? all I seem to be getting is back is just some random string of text like "1 Lists1048".
77 WS-DATE-FORMAT PIC X(11) VALUE IS SPACES.
77 WS-SIZE PIC X(4) COMP-N.
CALL "Kernel32.dll".
MOVE SPACES TO WS-DATE-FORMAT.
SET WS-SIZE TO SIZE OF WS-DATE-FORMAT.
CALL "GetProfileStringA" USING
BY REFERENCE "Intl",
BY REFERENCE "sShortDate",
BY REFERENCE "",
BY REFERENCE WS-DATE-FORMAT
BY REFERENCE WS-SIZE
END-CALL.
INSPECT WS-DATE-FORMAT REPLACING ALL LOW-VALUES BY SPACES.
CANCEL "Kernel32.dll".The reason I want this is because the stupid MS DTPIcker control lets you customize the date, but when you set the MINDATE or MAXDATE on it, then it needs to be in the format from the regional settings, the MIN and MAX date on the control don't use your custom date format!



