[Migrated content. Thread originally posted on 25 August 2004]
Well I am sure that this sounds stupid, but i just cannot see how to get an embedded date validation procedure to operate sensibly.
01 scr-main.
03.....
03.....
03 scr-date after procedure validate-date.
05 entry-field pic 99 using day auto.
05 entry-field pic 99 using month auto.
05 entry-field pic 99 year.
only enters the procedure validate-date for the first two 'auto' fields - not for the last one.
01 scr-main.
03.....
03.....
03 scr-date .
05 entry-field pic 99 using day auto
after procedure validate-date.
05 entry-field pic 99 using month auto
after procedure validate-date.
05 entry-field pic 99 year
after procedure validate-date.
This enters the procedure validate-date for all three elemental fields.
BUT - what I really want is for the after event procedure to only activate after the group field entry is finished i.e. only go to the procedure when leaving entry of the whole group field scr-date, otherwise I am dealing with incomplete date entry without knowing which field the operator has possibly clicked off to. So changing an initial dd/mm/yy date 300904 to 311004 makes my procedure validate after the day 30 is entered and gives an error for date 310904 - because i do not know that the next field to be entered is the month field. Control-value does not seem to help as it points at the terminating field, What on earth am I doing wrong here? It seems such an easy requirement and yet I just can't see how to do it - although it is late now and I'm tired. Hope someone can help.
[Migrated content. Thread originally posted on 25 August 2004]
Well I am sure that this sounds stupid, but i just cannot see how to get an embedded date validation procedure to operate sensibly.
01 scr-main.
03.....
03.....
03 scr-date after procedure validate-date.
05 entry-field pic 99 using day auto.
05 entry-field pic 99 using month auto.
05 entry-field pic 99 year.
only enters the procedure validate-date for the first two 'auto' fields - not for the last one.
01 scr-main.
03.....
03.....
03 scr-date .
05 entry-field pic 99 using day auto
after procedure validate-date.
05 entry-field pic 99 using month auto
after procedure validate-date.
05 entry-field pic 99 year
after procedure validate-date.
This enters the procedure validate-date for all three elemental fields.
BUT - what I really want is for the after event procedure to only activate after the group field entry is finished i.e. only go to the procedure when leaving entry of the whole group field scr-date, otherwise I am dealing with incomplete date entry without knowing which field the operator has possibly clicked off to. So changing an initial dd/mm/yy date 300904 to 311004 makes my procedure validate after the day 30 is entered and gives an error for date 310904 - because i do not know that the next field to be entered is the month field. Control-value does not seem to help as it points at the terminating field, What on earth am I doing wrong here? It seems such an easy requirement and yet I just can't see how to do it - although it is late now and I'm tired. Hope someone can help.
If you only want to perform a validation after the entire date has been entered, why don't concatenate it all to just one entry field?
[Migrated content. Thread originally posted on 25 August 2004]
Well I am sure that this sounds stupid, but i just cannot see how to get an embedded date validation procedure to operate sensibly.
01 scr-main.
03.....
03.....
03 scr-date after procedure validate-date.
05 entry-field pic 99 using day auto.
05 entry-field pic 99 using month auto.
05 entry-field pic 99 year.
only enters the procedure validate-date for the first two 'auto' fields - not for the last one.
01 scr-main.
03.....
03.....
03 scr-date .
05 entry-field pic 99 using day auto
after procedure validate-date.
05 entry-field pic 99 using month auto
after procedure validate-date.
05 entry-field pic 99 year
after procedure validate-date.
This enters the procedure validate-date for all three elemental fields.
BUT - what I really want is for the after event procedure to only activate after the group field entry is finished i.e. only go to the procedure when leaving entry of the whole group field scr-date, otherwise I am dealing with incomplete date entry without knowing which field the operator has possibly clicked off to. So changing an initial dd/mm/yy date 300904 to 311004 makes my procedure validate after the day 30 is entered and gives an error for date 310904 - because i do not know that the next field to be entered is the month field. Control-value does not seem to help as it points at the terminating field, What on earth am I doing wrong here? It seems such an easy requirement and yet I just can't see how to do it - although it is late now and I'm tired. Hope someone can help.
Keith,
What Gisle say is what we do in our application.
The screen item pic is defined as 99/99/9999, and we assign a variable to it which is defined like
01 WS-DATE-DDMMYYYY.
03 WS-DATE-DD PIC 99 VALUE ZEROS.
03 FILLER PIC X VALUE "/".
03 WS-DATE-MM PIC 99 VALUE ZEROS.
03 FILLER PIC X VALUE "/".
03 WS-DATE-YYYY PIC 9999 VALUE ZEROS.
Our users just "fill" in as much as they need to and then we fill in the blanks so to speak.
Entering 00 makes our date routine default the current date,
Entering 26 makes the date routine default the current month and year etc.
We have our own date routine because of a previous life with good old Microfocus, but I'm sure AcuCorp's date routines are equally as good as the routine we have, but I haven't looked at it.
Regards,
Shaun
[Migrated content. Thread originally posted on 25 August 2004]
Well I am sure that this sounds stupid, but i just cannot see how to get an embedded date validation procedure to operate sensibly.
01 scr-main.
03.....
03.....
03 scr-date after procedure validate-date.
05 entry-field pic 99 using day auto.
05 entry-field pic 99 using month auto.
05 entry-field pic 99 year.
only enters the procedure validate-date for the first two 'auto' fields - not for the last one.
01 scr-main.
03.....
03.....
03 scr-date .
05 entry-field pic 99 using day auto
after procedure validate-date.
05 entry-field pic 99 using month auto
after procedure validate-date.
05 entry-field pic 99 year
after procedure validate-date.
This enters the procedure validate-date for all three elemental fields.
BUT - what I really want is for the after event procedure to only activate after the group field entry is finished i.e. only go to the procedure when leaving entry of the whole group field scr-date, otherwise I am dealing with incomplete date entry without knowing which field the operator has possibly clicked off to. So changing an initial dd/mm/yy date 300904 to 311004 makes my procedure validate after the day 30 is entered and gives an error for date 310904 - because i do not know that the next field to be entered is the month field. Control-value does not seem to help as it points at the terminating field, What on earth am I doing wrong here? It seems such an easy requirement and yet I just can't see how to do it - although it is late now and I'm tired. Hope someone can help.
Thanks for the suggestions.
I would use a concatonated item but i want to have the field shown as 99/99/99 and in an entry field i cannot do this as even when i use the pic 99/99/99 variant in the entry-field clause, it still accepts the "/" characters rather than skippin g ober them (same happens if i use 99b99b99.
Screen decription fields do behave properly in relation to the 99/99/99 picture clause, but I lose the ability to change the font easily in the clause defining the item, i would have to put a frame up with white background to make it look the same as the rest of the entry fields on the screen (annoying but do-able) and i also find that these fields look odd and position differently and this also takes time to sort out. I must say that I am already a strong convert to the screen objects rather than the old picture stuff.
I do find it strange that the embedded procedure is so limiting when so much in this acu cobol for windows is so good - what I want to do is something that i can see many uses for in the programs i am converting (and as i have 973 to do i want to get things right the first time i mee up with them). In fact if I could just work out where the user had navigated to out of the date field then I would be able to crack it.
So unless I have misunderstood anything I am still looking for a solution. Ho Hum.....
Regards
Keith
[Migrated content. Thread originally posted on 25 August 2004]
Well I am sure that this sounds stupid, but i just cannot see how to get an embedded date validation procedure to operate sensibly.
01 scr-main.
03.....
03.....
03 scr-date after procedure validate-date.
05 entry-field pic 99 using day auto.
05 entry-field pic 99 using month auto.
05 entry-field pic 99 year.
only enters the procedure validate-date for the first two 'auto' fields - not for the last one.
01 scr-main.
03.....
03.....
03 scr-date .
05 entry-field pic 99 using day auto
after procedure validate-date.
05 entry-field pic 99 using month auto
after procedure validate-date.
05 entry-field pic 99 year
after procedure validate-date.
This enters the procedure validate-date for all three elemental fields.
BUT - what I really want is for the after event procedure to only activate after the group field entry is finished i.e. only go to the procedure when leaving entry of the whole group field scr-date, otherwise I am dealing with incomplete date entry without knowing which field the operator has possibly clicked off to. So changing an initial dd/mm/yy date 300904 to 311004 makes my procedure validate after the day 30 is entered and gives an error for date 310904 - because i do not know that the next field to be entered is the month field. Control-value does not seem to help as it points at the terminating field, What on earth am I doing wrong here? It seems such an easy requirement and yet I just can't see how to do it - although it is late now and I'm tired. Hope someone can help.
Ok, here goes.
The problem is in fact that the ENTRY control we use in the Windows runtime is just that, an entry field, it has no embedded logic to format the way you want.
Also, if I understand you right, you don't find it sufficient to format the string on exit from the entry field.
In that case, the only alternative I can think of is to use Microsoft MaskEd control.
We do provide this and examples of how to use it with our advanced Windows API training.
This component will also be one of those distributed with version 6.2 when this version is released.
[Migrated content. Thread originally posted on 25 August 2004]
Well I am sure that this sounds stupid, but i just cannot see how to get an embedded date validation procedure to operate sensibly.
01 scr-main.
03.....
03.....
03 scr-date after procedure validate-date.
05 entry-field pic 99 using day auto.
05 entry-field pic 99 using month auto.
05 entry-field pic 99 year.
only enters the procedure validate-date for the first two 'auto' fields - not for the last one.
01 scr-main.
03.....
03.....
03 scr-date .
05 entry-field pic 99 using day auto
after procedure validate-date.
05 entry-field pic 99 using month auto
after procedure validate-date.
05 entry-field pic 99 year
after procedure validate-date.
This enters the procedure validate-date for all three elemental fields.
BUT - what I really want is for the after event procedure to only activate after the group field entry is finished i.e. only go to the procedure when leaving entry of the whole group field scr-date, otherwise I am dealing with incomplete date entry without knowing which field the operator has possibly clicked off to. So changing an initial dd/mm/yy date 300904 to 311004 makes my procedure validate after the day 30 is entered and gives an error for date 310904 - because i do not know that the next field to be entered is the month field. Control-value does not seem to help as it points at the terminating field, What on earth am I doing wrong here? It seems such an easy requirement and yet I just can't see how to do it - although it is late now and I'm tired. Hope someone can help.
Gisle - thank you for your input to this.
Formatted entry fields would solve my problem - how can I get information on this MaskEd now - and how long till we get hands onto the 6.2 version that supports it?
Really though I could also solve my problem if the CMD-GOTO event gave details of the control that the user has clicked on (ID, screen position or anything). I have now used a before procedure on the elemental items in the date, and in the before procedure i display/accept a new individual group structure that contains the same elemental entry-fields for the date - now that there are no other fields in the accept I can do what I want - BUT I do not know what field the user has then clicked on - so have to default to the next field on the screen - not great but a lot better than what I had.
Having read further in the manual on embedded procedures, I tried to set the group level after procedure, and then to set the elemental items after procedure to NULL. The manual suggests that this will over-ride the group after procedure clause - it doesnt otherwise again I would have solved my problem. Whilst having formatted entry fields would be nice - if the embedded procedures would behave sensibly at the group level then these issues would be easier to deal with.
I will check when the next Windows advanced API course is being done in the UK - although I am not a Windows programmer at all - just a grunt Cobol programmer that makes things work (most of the time!). Are there any knowledge requirements needed to make attending this course worthwhile?
Regards
Keith
[Migrated content. Thread originally posted on 25 August 2004]
Well I am sure that this sounds stupid, but i just cannot see how to get an embedded date validation procedure to operate sensibly.
01 scr-main.
03.....
03.....
03 scr-date after procedure validate-date.
05 entry-field pic 99 using day auto.
05 entry-field pic 99 using month auto.
05 entry-field pic 99 year.
only enters the procedure validate-date for the first two 'auto' fields - not for the last one.
01 scr-main.
03.....
03.....
03 scr-date .
05 entry-field pic 99 using day auto
after procedure validate-date.
05 entry-field pic 99 using month auto
after procedure validate-date.
05 entry-field pic 99 year
after procedure validate-date.
This enters the procedure validate-date for all three elemental fields.
BUT - what I really want is for the after event procedure to only activate after the group field entry is finished i.e. only go to the procedure when leaving entry of the whole group field scr-date, otherwise I am dealing with incomplete date entry without knowing which field the operator has possibly clicked off to. So changing an initial dd/mm/yy date 300904 to 311004 makes my procedure validate after the day 30 is entered and gives an error for date 310904 - because i do not know that the next field to be entered is the month field. Control-value does not seem to help as it points at the terminating field, What on earth am I doing wrong here? It seems such an easy requirement and yet I just can't see how to do it - although it is late now and I'm tired. Hope someone can help.
Lots of questions here, I will try to answer them all.
As for the control, it is certainly available on a machine near you now as well. The "trick" with 6.2 is that we provide it, and the runtime will automatically check out a license on it, contrary to if you should happen to find it somewhere today you will be on your own.
As for when 6.2 will be released, you will have to check that with your contact in UK for that.
As for the Adv. Windows training, I don't think there is anything planned for UK for the time being, again, you got to check with the UK office. But, COBOL developer is what you got to be to attend this course. The purpose is to tell COBOL developers how they can utilize the Windows API to help them resolve special needs. It is indeed a benefit if you are familiar with Windows and some GUI programming.
However, one question regarding your case here. Do you have an EVENT procedure declared for your entry field? (this differs significantly from a BEFORE, AFTER procedure) If so, have you also applied the
NOTIFY-CHANGE for your entryfield? And if still so, do you monitor the NTF-CHANGED event?
Because, if you do so, you should get a notification everytime the user change something, then you can get the value of the entryfield and reformat it on the fly in exactly the style, padding you desire. Thus no need for activex).
Somewhat pseudo code goes here:
DISPLAY myentryfield
HANDLE IN myehandle
NOTIFY-CHANGE
EVENT PROCEDURE myevent
...
myevent.
INQUIRE myentryfield VALUE IN mystring.
... modify the string to your desire
MODIFY myentryfield VALUE = mystring | modified string
[\\CODE]
Also, you should be able to identify the control by checking
EVENT-CONTROL-ID (if ID is set).
Hope this helps.
[Migrated content. Thread originally posted on 25 August 2004]
Well I am sure that this sounds stupid, but i just cannot see how to get an embedded date validation procedure to operate sensibly.
01 scr-main.
03.....
03.....
03 scr-date after procedure validate-date.
05 entry-field pic 99 using day auto.
05 entry-field pic 99 using month auto.
05 entry-field pic 99 year.
only enters the procedure validate-date for the first two 'auto' fields - not for the last one.
01 scr-main.
03.....
03.....
03 scr-date .
05 entry-field pic 99 using day auto
after procedure validate-date.
05 entry-field pic 99 using month auto
after procedure validate-date.
05 entry-field pic 99 year
after procedure validate-date.
This enters the procedure validate-date for all three elemental fields.
BUT - what I really want is for the after event procedure to only activate after the group field entry is finished i.e. only go to the procedure when leaving entry of the whole group field scr-date, otherwise I am dealing with incomplete date entry without knowing which field the operator has possibly clicked off to. So changing an initial dd/mm/yy date 300904 to 311004 makes my procedure validate after the day 30 is entered and gives an error for date 310904 - because i do not know that the next field to be entered is the month field. Control-value does not seem to help as it points at the terminating field, What on earth am I doing wrong here? It seems such an easy requirement and yet I just can't see how to do it - although it is late now and I'm tired. Hope someone can help.
The "trick" with 6.2 is that we provide it, and the runtime will automatically check out a license on it, contrary to if you should happen to find it somewhere today you will be on your own.
Just curious - by "provide it", does that mean that it will somehow be embedded into the runtime or will just be installed/registered via an installation process with the rest of the runtime?
[Migrated content. Thread originally posted on 25 August 2004]
Well I am sure that this sounds stupid, but i just cannot see how to get an embedded date validation procedure to operate sensibly.
01 scr-main.
03.....
03.....
03 scr-date after procedure validate-date.
05 entry-field pic 99 using day auto.
05 entry-field pic 99 using month auto.
05 entry-field pic 99 year.
only enters the procedure validate-date for the first two 'auto' fields - not for the last one.
01 scr-main.
03.....
03.....
03 scr-date .
05 entry-field pic 99 using day auto
after procedure validate-date.
05 entry-field pic 99 using month auto
after procedure validate-date.
05 entry-field pic 99 year
after procedure validate-date.
This enters the procedure validate-date for all three elemental fields.
BUT - what I really want is for the after event procedure to only activate after the group field entry is finished i.e. only go to the procedure when leaving entry of the whole group field scr-date, otherwise I am dealing with incomplete date entry without knowing which field the operator has possibly clicked off to. So changing an initial dd/mm/yy date 300904 to 311004 makes my procedure validate after the day 30 is entered and gives an error for date 310904 - because i do not know that the next field to be entered is the month field. Control-value does not seem to help as it points at the terminating field, What on earth am I doing wrong here? It seems such an easy requirement and yet I just can't see how to do it - although it is late now and I'm tired. Hope someone can help.
By saying provide it, we do:
Include the binaries on the ACUCOBOL-GT installation CD in a separate directory. With documentation so that you will know what files to distribute. But you will have to do the distribution yourself.
You will have to register the component yourself, but you don't have to worry about licenses, the runtime will automatically provide a license for the component when it is displayed.
This will be discussed in more detail in the upcoming ACUCOBOL-GT newsletter.