Highlighted
Absent Member.
Absent Member.
1115 views

[archive] Microsoft Date Time Picker

[Migrated content. Thread originally posted on 24 March 2003]

Does anyone know how to get the Microsoft Date Time Picker
to display something different than the current date when the screen first displays??

Thank you very much
0 Likes
3 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Microsoft Date Time Picker

There's a couple of different ways to do it.
You could modify the control for the individual month, day, and year elements.
for example:

MODIFY DTP-1 @Day(26).
MODIFY DTP-1 @Month(03).
MODIFY DTP-1 @Year(2003).

Or, you could just move the date you want to a variable and modify the value of the control.
for example:

MOVE "3/26/2003" TO TEST-VALUE.
MODIFY DTP-1 @Value(TEST-VALUE).

I had TEST-VALUE defined as PIC X(10).

Both ways give you a 3/26/2003 date.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Microsoft Date Time Picker

A small correction if I may,

The Day, Month and Year are properties of the DTPicker control, not methods. As methods should use parenthesis and properties not, I would suggest one distinguishes in this, hence:

MODIFY DTP-1 @Day = 26.
MODIFY DTP-1 @Month = 03.
MODIFY DTP-1 @Year = 2003.

Also, note that the @ character are optional as long as the succeeding word is not in conflict with a reserved ACUCOBOL-GT word. Day, Month and Year are not in conflict, and may as such be used without the @ prefix.
"Value" on the contrary, are a reserved ACUCOBOL-GT word and should be prefixed with @ to make it clear that we want the control version executed.

A note on simplicity, are you aware that you can simplify the above, by doing this:

MODIFY DTP-1
Day = 26
Month = 03
Year = 2003.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Microsoft Date Time Picker

Thank you both very much
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.