It would make our life so much easier if we could inquire the tab-order value of a control. If we can’t have that, could you allow us to inquire the name of the control as a text field? Either of these would be read-only of course.
The inquire would be a format 1 query:
77 my-tab-order usage unsigned-short.
77 my-control-name pic x(30).
INQUIRE { control-item } tab-order in my-tab-order.
INQUIRE { control-item } name in my-control-name.
Now the more difficult request. Since you already have the control handles somewhere in the runtime’s memory, and the tab order in there too, allow me to inquire by the tab-order. If that can be done then let’s take it one step further and allow me to modify controls using the tab-order instead of the handle.
Here is an example of why either of these values would be useful… Postal Codes aka Zip Codes.
If the tab-order were available:
When a user enters the zip code I know that the state is the preceding field and the city is the field prior to that in the tab order. I have the current control’s handle in event-control-handle. If I was able to inquire the tab-order of the controls then I could create a table of the tab-order and control handles. This would allow me to use the postal code to populate the City and State and/or validate the user-entered city and state on the two preceding fields.
If the name were available:
When a user enters the zip code I would be able to parse the name and see if it was the shipping zip or the billing zip. This would allow me to know if I should populate s-city or b-city based on the current control’s value. However, I don’t have a way to know the name of the current control. I have the handle in event-control-handle but no way to know the name of the current control.
It would make our life so much easier if we could inquire the tab-order value of a control. If we can’t have that, could you allow us to inquire the name of the control as a text field? Either of these would be read-only of course.
The inquire would be a format 1 query:
77 my-tab-order usage unsigned-short.
77 my-control-name pic x(30).
INQUIRE { control-item } tab-order in my-tab-order.
INQUIRE { control-item } name in my-control-name.
Now the more difficult request. Since you already have the control handles somewhere in the runtime’s memory, and the tab order in there too, allow me to inquire by the tab-order. If that can be done then let’s take it one step further and allow me to modify controls using the tab-order instead of the handle.
Here is an example of why either of these values would be useful… Postal Codes aka Zip Codes.
If the tab-order were available:
When a user enters the zip code I know that the state is the preceding field and the city is the field prior to that in the tab order. I have the current control’s handle in event-control-handle. If I was able to inquire the tab-order of the controls then I could create a table of the tab-order and control handles. This would allow me to use the postal code to populate the City and State and/or validate the user-entered city and state on the two preceding fields.
If the name were available:
When a user enters the zip code I would be able to parse the name and see if it was the shipping zip or the billing zip. This would allow me to know if I should populate s-city or b-city based on the current control’s value. However, I don’t have a way to know the name of the current control. I have the handle in event-control-handle but no way to know the name of the current control.
INQUIRE { control-item } name in my-control-name. How is control-item being determined? For instance, with AcuBench an entry-field might be Form1-ef-1 which is also the handle .. Inquire Form1-ef-1 size in size-ef.
It would make our life so much easier if we could inquire the tab-order value of a control. If we can’t have that, could you allow us to inquire the name of the control as a text field? Either of these would be read-only of course.
The inquire would be a format 1 query:
77 my-tab-order usage unsigned-short.
77 my-control-name pic x(30).
INQUIRE { control-item } tab-order in my-tab-order.
INQUIRE { control-item } name in my-control-name.
Now the more difficult request. Since you already have the control handles somewhere in the runtime’s memory, and the tab order in there too, allow me to inquire by the tab-order. If that can be done then let’s take it one step further and allow me to modify controls using the tab-order instead of the handle.
Here is an example of why either of these values would be useful… Postal Codes aka Zip Codes.
If the tab-order were available:
When a user enters the zip code I know that the state is the preceding field and the city is the field prior to that in the tab order. I have the current control’s handle in event-control-handle. If I was able to inquire the tab-order of the controls then I could create a table of the tab-order and control handles. This would allow me to use the postal code to populate the City and State and/or validate the user-entered city and state on the two preceding fields.
If the name were available:
When a user enters the zip code I would be able to parse the name and see if it was the shipping zip or the billing zip. This would allow me to know if I should populate s-city or b-city based on the current control’s value. However, I don’t have a way to know the name of the current control. I have the handle in event-control-handle but no way to know the name of the current control.
Since this would be at run-time, not design time, the inquiry would be by the control handle from event-control-handle.
It would make our life so much easier if we could inquire the tab-order value of a control. If we can’t have that, could you allow us to inquire the name of the control as a text field? Either of these would be read-only of course.
The inquire would be a format 1 query:
77 my-tab-order usage unsigned-short.
77 my-control-name pic x(30).
INQUIRE { control-item } tab-order in my-tab-order.
INQUIRE { control-item } name in my-control-name.
Now the more difficult request. Since you already have the control handles somewhere in the runtime’s memory, and the tab order in there too, allow me to inquire by the tab-order. If that can be done then let’s take it one step further and allow me to modify controls using the tab-order instead of the handle.
Here is an example of why either of these values would be useful… Postal Codes aka Zip Codes.
If the tab-order were available:
When a user enters the zip code I know that the state is the preceding field and the city is the field prior to that in the tab order. I have the current control’s handle in event-control-handle. If I was able to inquire the tab-order of the controls then I could create a table of the tab-order and control handles. This would allow me to use the postal code to populate the City and State and/or validate the user-entered city and state on the two preceding fields.
If the name were available:
When a user enters the zip code I would be able to parse the name and see if it was the shipping zip or the billing zip. This would allow me to know if I should populate s-city or b-city based on the current control’s value. However, I don’t have a way to know the name of the current control. I have the handle in event-control-handle but no way to know the name of the current control.
For your first example... Why not just modify the city and state fields in the ntf-changed event or exception paragraphs of the postal code field?
And for your second one... Could you just not fire an ntf-changed event or exception for those controls and handle them?
Correct me if I am wrong, but it really sounds like you are trying to reinvent the wheel and are trying to act in a global hey-an-event-happened-where-did-it-happen type of manner. You should be writing event handling code for specific events happening in/on specific controls.
It would make our life so much easier if we could inquire the tab-order value of a control. If we can’t have that, could you allow us to inquire the name of the control as a text field? Either of these would be read-only of course.
The inquire would be a format 1 query:
77 my-tab-order usage unsigned-short.
77 my-control-name pic x(30).
INQUIRE { control-item } tab-order in my-tab-order.
INQUIRE { control-item } name in my-control-name.
Now the more difficult request. Since you already have the control handles somewhere in the runtime’s memory, and the tab order in there too, allow me to inquire by the tab-order. If that can be done then let’s take it one step further and allow me to modify controls using the tab-order instead of the handle.
Here is an example of why either of these values would be useful… Postal Codes aka Zip Codes.
If the tab-order were available:
When a user enters the zip code I know that the state is the preceding field and the city is the field prior to that in the tab order. I have the current control’s handle in event-control-handle. If I was able to inquire the tab-order of the controls then I could create a table of the tab-order and control handles. This would allow me to use the postal code to populate the City and State and/or validate the user-entered city and state on the two preceding fields.
If the name were available:
When a user enters the zip code I would be able to parse the name and see if it was the shipping zip or the billing zip. This would allow me to know if I should populate s-city or b-city based on the current control’s value. However, I don’t have a way to know the name of the current control. I have the handle in event-control-handle but no way to know the name of the current control.
For your first example... Why not just modify the city and state fields in the ntf-changed event or exception paragraphs of the postal code field?
And for your second one... Could you just not fire an ntf-changed event or exception for those controls and handle them?
Correct me if I am wrong, but it really sounds like you are trying to reinvent the wheel and are trying to act in a global hey-an-event-happened-where-did-it-happen type of manner. You should be writing event handling code for specific events happening in/on specific controls.
It would make our life so much easier if we could inquire the tab-order value of a control. If we can’t have that, could you allow us to inquire the name of the control as a text field? Either of these would be read-only of course.
The inquire would be a format 1 query:
77 my-tab-order usage unsigned-short.
77 my-control-name pic x(30).
INQUIRE { control-item } tab-order in my-tab-order.
INQUIRE { control-item } name in my-control-name.
Now the more difficult request. Since you already have the control handles somewhere in the runtime’s memory, and the tab order in there too, allow me to inquire by the tab-order. If that can be done then let’s take it one step further and allow me to modify controls using the tab-order instead of the handle.
Here is an example of why either of these values would be useful… Postal Codes aka Zip Codes.
If the tab-order were available:
When a user enters the zip code I know that the state is the preceding field and the city is the field prior to that in the tab order. I have the current control’s handle in event-control-handle. If I was able to inquire the tab-order of the controls then I could create a table of the tab-order and control handles. This would allow me to use the postal code to populate the City and State and/or validate the user-entered city and state on the two preceding fields.
If the name were available:
When a user enters the zip code I would be able to parse the name and see if it was the shipping zip or the billing zip. This would allow me to know if I should populate s-city or b-city based on the current control’s value. However, I don’t have a way to know the name of the current control. I have the handle in event-control-handle but no way to know the name of the current control.
For your first example... Why not just modify the city and state fields in the ntf-changed event or exception paragraphs of the postal code field?
And for your second one... Could you just not fire an ntf-changed event or exception for those controls and handle them?
Correct me if I am wrong, but it really sounds like you are trying to reinvent the wheel and are trying to act in a global hey-an-event-happened-where-did-it-happen type of manner. You should be writing event handling code for specific events happening in/on specific controls.
It would make our life so much easier if we could inquire the tab-order value of a control. If we can’t have that, could you allow us to inquire the name of the control as a text field? Either of these would be read-only of course.
The inquire would be a format 1 query:
77 my-tab-order usage unsigned-short.
77 my-control-name pic x(30).
INQUIRE { control-item } tab-order in my-tab-order.
INQUIRE { control-item } name in my-control-name.
Now the more difficult request. Since you already have the control handles somewhere in the runtime’s memory, and the tab order in there too, allow me to inquire by the tab-order. If that can be done then let’s take it one step further and allow me to modify controls using the tab-order instead of the handle.
Here is an example of why either of these values would be useful… Postal Codes aka Zip Codes.
If the tab-order were available:
When a user enters the zip code I know that the state is the preceding field and the city is the field prior to that in the tab order. I have the current control’s handle in event-control-handle. If I was able to inquire the tab-order of the controls then I could create a table of the tab-order and control handles. This would allow me to use the postal code to populate the City and State and/or validate the user-entered city and state on the two preceding fields.
If the name were available:
When a user enters the zip code I would be able to parse the name and see if it was the shipping zip or the billing zip. This would allow me to know if I should populate s-city or b-city based on the current control’s value. However, I don’t have a way to know the name of the current control. I have the handle in event-control-handle but no way to know the name of the current control.
Bill,
What you inferred is exactly right. I am trying to create an exception handling routine that applies enterprise wide. The zip code example is an general example that everyone can understand. I provided a simple example to avoid the following description.
Throughout or product we have entry fields with associated buttons. The button follows the entry field in tab order. The button provides a lookup function for the valid entry field values. We also trap an F2 exception key from the entry field that will have the same function as the button click event. Most of our users have the valid values for their task memorized. However, sometimes they need to refer to the list of thousands of choices. Combo boxes are not an option because there are so many choices and because we need to provide a summary of the possible selection. The presentation of the list is done with a grid where we have a search and filter option to assist the user in finding their appropriate selection. We also display summary information in a label as they navigate through the grid. The user's choice is returned to the parent program to populate the entry field.
At the time of the event I do know whether the request is from the entry-field or the button. However, when on the button I have no way to modify the entry field value. I do not know the entry field's handle value so MODIFY { control-item } is not an option. I did experiment with modifying the entry field using MODIFY CONTROL AT LINE x COLUMN y but was unsuccessful since I cannot INQUIRE the line value or column value of the button click. If that were possible then I could make an educated guess as to the location of the entry field based on the coordinates of the button. Even if this were possible I would rather not guess.
I also investigated using the help-id and control-id fields but given the number of screens and fields in our product human error will occur. Being able to inquire and modify by the tab order will provide a better product for my customers and reduce coding for my co-workers.
ATTN SHJERPE: While I am asking I might as well add a request for the ability to iterate through a screen's collection of controls without knowing the control's handle.
It would make our life so much easier if we could inquire the tab-order value of a control. If we can’t have that, could you allow us to inquire the name of the control as a text field? Either of these would be read-only of course.
The inquire would be a format 1 query:
77 my-tab-order usage unsigned-short.
77 my-control-name pic x(30).
INQUIRE { control-item } tab-order in my-tab-order.
INQUIRE { control-item } name in my-control-name.
Now the more difficult request. Since you already have the control handles somewhere in the runtime’s memory, and the tab order in there too, allow me to inquire by the tab-order. If that can be done then let’s take it one step further and allow me to modify controls using the tab-order instead of the handle.
Here is an example of why either of these values would be useful… Postal Codes aka Zip Codes.
If the tab-order were available:
When a user enters the zip code I know that the state is the preceding field and the city is the field prior to that in the tab order. I have the current control’s handle in event-control-handle. If I was able to inquire the tab-order of the controls then I could create a table of the tab-order and control handles. This would allow me to use the postal code to populate the City and State and/or validate the user-entered city and state on the two preceding fields.
If the name were available:
When a user enters the zip code I would be able to parse the name and see if it was the shipping zip or the billing zip. This would allow me to know if I should populate s-city or b-city based on the current control’s value. However, I don’t have a way to know the name of the current control. I have the handle in event-control-handle but no way to know the name of the current control.
Bill,
What you inferred is exactly right. I am trying to create an exception handling routine that applies enterprise wide. The zip code example is an general example that everyone can understand. I provided a simple example to avoid the following description.
Throughout or product we have entry fields with associated buttons. The button follows the entry field in tab order. The button provides a lookup function for the valid entry field values. We also trap an F2 exception key from the entry field that will have the same function as the button click event. Most of our users have the valid values for their task memorized. However, sometimes they need to refer to the list of thousands of choices. Combo boxes are not an option because there are so many choices and because we need to provide a summary of the possible selection. The presentation of the list is done with a grid where we have a search and filter option to assist the user in finding their appropriate selection. We also display summary information in a label as they navigate through the grid. The user's choice is returned to the parent program to populate the entry field.
At the time of the event I do know whether the request is from the entry-field or the button. However, when on the button I have no way to modify the entry field value. I do not know the entry field's handle value so MODIFY { control-item } is not an option. I did experiment with modifying the entry field using MODIFY CONTROL AT LINE x COLUMN y but was unsuccessful since I cannot INQUIRE the line value or column value of the button click. If that were possible then I could make an educated guess as to the location of the entry field based on the coordinates of the button. Even if this were possible I would rather not guess.
I also investigated using the help-id and control-id fields but given the number of screens and fields in our product human error will occur. Being able to inquire and modify by the tab order will provide a better product for my customers and reduce coding for my co-workers.
ATTN SHJERPE: While I am asking I might as well add a request for the ability to iterate through a screen's collection of controls without knowing the control's handle.
It would make our life so much easier if we could inquire the tab-order value of a control. If we can’t have that, could you allow us to inquire the name of the control as a text field? Either of these would be read-only of course.
The inquire would be a format 1 query:
77 my-tab-order usage unsigned-short.
77 my-control-name pic x(30).
INQUIRE { control-item } tab-order in my-tab-order.
INQUIRE { control-item } name in my-control-name.
Now the more difficult request. Since you already have the control handles somewhere in the runtime’s memory, and the tab order in there too, allow me to inquire by the tab-order. If that can be done then let’s take it one step further and allow me to modify controls using the tab-order instead of the handle.
Here is an example of why either of these values would be useful… Postal Codes aka Zip Codes.
If the tab-order were available:
When a user enters the zip code I know that the state is the preceding field and the city is the field prior to that in the tab order. I have the current control’s handle in event-control-handle. If I was able to inquire the tab-order of the controls then I could create a table of the tab-order and control handles. This would allow me to use the postal code to populate the City and State and/or validate the user-entered city and state on the two preceding fields.
If the name were available:
When a user enters the zip code I would be able to parse the name and see if it was the shipping zip or the billing zip. This would allow me to know if I should populate s-city or b-city based on the current control’s value. However, I don’t have a way to know the name of the current control. I have the handle in event-control-handle but no way to know the name of the current control.
Wouldn't control IDs assigned in ascending order solve your problem? You would then know that the entry field ID is one less than the button ID. You could get the button's ID with an INQUIRE and then get the entry field handle with HANDLE OF CONTROL ID (button-id - 1). (Disclaimer: I am not an expert on ACU-GT, just a passing acquaintance.)
It would make our life so much easier if we could inquire the tab-order value of a control. If we can’t have that, could you allow us to inquire the name of the control as a text field? Either of these would be read-only of course.
The inquire would be a format 1 query:
77 my-tab-order usage unsigned-short.
77 my-control-name pic x(30).
INQUIRE { control-item } tab-order in my-tab-order.
INQUIRE { control-item } name in my-control-name.
Now the more difficult request. Since you already have the control handles somewhere in the runtime’s memory, and the tab order in there too, allow me to inquire by the tab-order. If that can be done then let’s take it one step further and allow me to modify controls using the tab-order instead of the handle.
Here is an example of why either of these values would be useful… Postal Codes aka Zip Codes.
If the tab-order were available:
When a user enters the zip code I know that the state is the preceding field and the city is the field prior to that in the tab order. I have the current control’s handle in event-control-handle. If I was able to inquire the tab-order of the controls then I could create a table of the tab-order and control handles. This would allow me to use the postal code to populate the City and State and/or validate the user-entered city and state on the two preceding fields.
If the name were available:
When a user enters the zip code I would be able to parse the name and see if it was the shipping zip or the billing zip. This would allow me to know if I should populate s-city or b-city based on the current control’s value. However, I don’t have a way to know the name of the current control. I have the handle in event-control-handle but no way to know the name of the current control.
That may work, Mr. Sinclair, assuming I can trust the runtime to build the screen, and therefore assign control-id, in tab-order. This may be a safe assumption according to section 5.9, General Rules for Format 2 Screen Description Entries. Fortunately, we do not set control-id at design time so control-id will always be zero until the runtime sets it.
I will have control-id when F2 is used on an entry field. Also, I will have event-control-id when a button is pressed. As you described, I could use the Format 11 SET statement to get the handle for the entry field.
I will test this soon and post the results. Hopefully I will know by tomorrow.
It would make our life so much easier if we could inquire the tab-order value of a control. If we can’t have that, could you allow us to inquire the name of the control as a text field? Either of these would be read-only of course.
The inquire would be a format 1 query:
77 my-tab-order usage unsigned-short.
77 my-control-name pic x(30).
INQUIRE { control-item } tab-order in my-tab-order.
INQUIRE { control-item } name in my-control-name.
Now the more difficult request. Since you already have the control handles somewhere in the runtime’s memory, and the tab order in there too, allow me to inquire by the tab-order. If that can be done then let’s take it one step further and allow me to modify controls using the tab-order instead of the handle.
Here is an example of why either of these values would be useful… Postal Codes aka Zip Codes.
If the tab-order were available:
When a user enters the zip code I know that the state is the preceding field and the city is the field prior to that in the tab order. I have the current control’s handle in event-control-handle. If I was able to inquire the tab-order of the controls then I could create a table of the tab-order and control handles. This would allow me to use the postal code to populate the City and State and/or validate the user-entered city and state on the two preceding fields.
If the name were available:
When a user enters the zip code I would be able to parse the name and see if it was the shipping zip or the billing zip. This would allow me to know if I should populate s-city or b-city based on the current control’s value. However, I don’t have a way to know the name of the current control. I have the handle in event-control-handle but no way to know the name of the current control.
That may work, Mr. Sinclair, assuming I can trust the runtime to build the screen, and therefore assign control-id, in tab-order. This may be a safe assumption according to section 5.9, General Rules for Format 2 Screen Description Entries. Fortunately, we do not set control-id at design time so control-id will always be zero until the runtime sets it.
I will have control-id when F2 is used on an entry field. Also, I will have event-control-id when a button is pressed. As you described, I could use the Format 11 SET statement to get the handle for the entry field.
I will test this soon and post the results. Hopefully I will know by tomorrow.
It would make our life so much easier if we could inquire the tab-order value of a control. If we can’t have that, could you allow us to inquire the name of the control as a text field? Either of these would be read-only of course.
The inquire would be a format 1 query:
77 my-tab-order usage unsigned-short.
77 my-control-name pic x(30).
INQUIRE { control-item } tab-order in my-tab-order.
INQUIRE { control-item } name in my-control-name.
Now the more difficult request. Since you already have the control handles somewhere in the runtime’s memory, and the tab order in there too, allow me to inquire by the tab-order. If that can be done then let’s take it one step further and allow me to modify controls using the tab-order instead of the handle.
Here is an example of why either of these values would be useful… Postal Codes aka Zip Codes.
If the tab-order were available:
When a user enters the zip code I know that the state is the preceding field and the city is the field prior to that in the tab order. I have the current control’s handle in event-control-handle. If I was able to inquire the tab-order of the controls then I could create a table of the tab-order and control handles. This would allow me to use the postal code to populate the City and State and/or validate the user-entered city and state on the two preceding fields.
If the name were available:
When a user enters the zip code I would be able to parse the name and see if it was the shipping zip or the billing zip. This would allow me to know if I should populate s-city or b-city based on the current control’s value. However, I don’t have a way to know the name of the current control. I have the handle in event-control-handle but no way to know the name of the current control.
That may work, Mr. Sinclair, assuming I can trust the runtime to build the screen, and therefore assign control-id, in tab-order. This may be a safe assumption according to section 5.9, General Rules for Format 2 Screen Description Entries. Fortunately, we do not set control-id at design time so control-id will always be zero until the runtime sets it.
I will have control-id when F2 is used on an entry field. Also, I will have event-control-id when a button is pressed. As you described, I could use the Format 11 SET statement to get the handle for the entry field.
I will test this soon and post the results. Hopefully I will know by tomorrow.
It would make our life so much easier if we could inquire the tab-order value of a control. If we can’t have that, could you allow us to inquire the name of the control as a text field? Either of these would be read-only of course.
The inquire would be a format 1 query:
77 my-tab-order usage unsigned-short.
77 my-control-name pic x(30).
INQUIRE { control-item } tab-order in my-tab-order.
INQUIRE { control-item } name in my-control-name.
Now the more difficult request. Since you already have the control handles somewhere in the runtime’s memory, and the tab order in there too, allow me to inquire by the tab-order. If that can be done then let’s take it one step further and allow me to modify controls using the tab-order instead of the handle.
Here is an example of why either of these values would be useful… Postal Codes aka Zip Codes.
If the tab-order were available:
When a user enters the zip code I know that the state is the preceding field and the city is the field prior to that in the tab order. I have the current control’s handle in event-control-handle. If I was able to inquire the tab-order of the controls then I could create a table of the tab-order and control handles. This would allow me to use the postal code to populate the City and State and/or validate the user-entered city and state on the two preceding fields.
If the name were available:
When a user enters the zip code I would be able to parse the name and see if it was the shipping zip or the billing zip. This would allow me to know if I should populate s-city or b-city based on the current control’s value. However, I don’t have a way to know the name of the current control. I have the handle in event-control-handle but no way to know the name of the current control.
Success, Mr. Sinclair!
The event paragraphs have no reference to the control name. Therefore, no modification is need for different controls. Also, we will be able to use the Code Template (ctrl-J) settings in AcuBench to automatically insert the event paragraph code.
=== Working Storage ===
77 ws-ef-control-id pic 9(10) value zero.
77 ws-ef-help-id pic 9(10) value zero.
77 ws-ef-handle usage handle of entry-field.
=== Event Procedures ===
F2Test-Ef-2-Ex-Other.
if Key-Status = f2-key
move control-id to ws-ef-control-id
perform handle-a-lookup-request
end-if
.
F2Test-Pb-2-Ev-Cmd-Clicked.
compute ws-ef-control-id = event-control-id - 1
perform handle-a-lookup-request
.
=== In the PDLOOKUP Copy Library ===
handle-a-lookup-request.
set ws-ef-handle to handle of id ws-ef-control-id
inquire ws-ef-control-id help-id in ws-ef-help-id
initialize lk-lookup-area.
* evaluate ws-ef-help-id here to set the lookup type
set lk-lookup-unit-test to true.
* end-evaluate.
perform call-lookup.
modify ws-ef-handle, VALUE = lk-lookup-value
initialize ws-ef-handle.
.
It would make our life so much easier if we could inquire the tab-order value of a control. If we can’t have that, could you allow us to inquire the name of the control as a text field? Either of these would be read-only of course.
The inquire would be a format 1 query:
77 my-tab-order usage unsigned-short.
77 my-control-name pic x(30).
INQUIRE { control-item } tab-order in my-tab-order.
INQUIRE { control-item } name in my-control-name.
Now the more difficult request. Since you already have the control handles somewhere in the runtime’s memory, and the tab order in there too, allow me to inquire by the tab-order. If that can be done then let’s take it one step further and allow me to modify controls using the tab-order instead of the handle.
Here is an example of why either of these values would be useful… Postal Codes aka Zip Codes.
If the tab-order were available:
When a user enters the zip code I know that the state is the preceding field and the city is the field prior to that in the tab order. I have the current control’s handle in event-control-handle. If I was able to inquire the tab-order of the controls then I could create a table of the tab-order and control handles. This would allow me to use the postal code to populate the City and State and/or validate the user-entered city and state on the two preceding fields.
If the name were available:
When a user enters the zip code I would be able to parse the name and see if it was the shipping zip or the billing zip. This would allow me to know if I should populate s-city or b-city based on the current control’s value. However, I don’t have a way to know the name of the current control. I have the handle in event-control-handle but no way to know the name of the current control.
Success, Mr. Sinclair!
The event paragraphs have no reference to the control name. Therefore, no modification is need for different controls. Also, we will be able to use the Code Template (ctrl-J) settings in AcuBench to automatically insert the event paragraph code.
=== Working Storage ===
77 ws-ef-control-id pic 9(10) value zero.
77 ws-ef-help-id pic 9(10) value zero.
77 ws-ef-handle usage handle of entry-field.
=== Event Procedures ===
F2Test-Ef-2-Ex-Other.
if Key-Status = f2-key
move control-id to ws-ef-control-id
perform handle-a-lookup-request
end-if
.
F2Test-Pb-2-Ev-Cmd-Clicked.
compute ws-ef-control-id = event-control-id - 1
perform handle-a-lookup-request
.
=== In the PDLOOKUP Copy Library ===
handle-a-lookup-request.
set ws-ef-handle to handle of id ws-ef-control-id
inquire ws-ef-control-id help-id in ws-ef-help-id
initialize lk-lookup-area.
* evaluate ws-ef-help-id here to set the lookup type
set lk-lookup-unit-test to true.
* end-evaluate.
perform call-lookup.
modify ws-ef-handle, VALUE = lk-lookup-value
initialize ws-ef-handle.
.
Sign up
Already have an account? Login
Welcome to the Rocket Forum!
Please log in or register:
Employee Login | Registration Member Login | RegistrationEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.