I need your help to solve a doubt about perform a action, but I don't know if Natural allows to implement this solution. The question is: There are any way to take an action during a field fill?
For example: I have a direct loop that controls a INPUT of a variable (alphanumeric). This variable represents a keyword used to search names in database (Adabas) based on its value. So I want to perform a action to realize a search while user fills the field without hitting ENTER or another *PF-KEY, then the system performs the search and brings the records that match with the value entered. It's something just like Google does when we start to type the keywords that we to search and it brings immediately the results that match with words typed by the user.
Could somebody help me?
Thanks for attention.
Can you PLEASE post this in a relevant category (Natural General » Natural News and General Topics is definitely not where it belongs) and provide more information about the environment ?
Are we talking about Natural for Ajax here ?
I’m using Natural on Unix.
OP-System …: AIX
NAT-Ver …: V 18.104.22.168
So, there’s a way to make something like this?
No, it requires the Enter or a PF-Key to be hit to trigger the INPUT,
data / events will not be sent to the Natural program on individual key strokes.
Just to add to Wolfgang’s answer re Unix.
Natural on the PC does have “change” events, which permit what you wish to do.
Under Unix, the closest you will get to this is a “wildcard” implementation. The user enters something like ROG* in the search field. In your Natural code, you can do an
EXAMINE “input variable” FOR ‘*’ DELETE…GIVING NUMBER #NUM
Then, if #NUM is not zero, you can MOVE the input variable (without the asterisk because of the DELETE option) to a variable like #START.
You could then have a READ…STARTING FROM #START with appropriate code to limit the READ loop to values which start with #START.
If #NUM is zero, you would probably do a FIND with the search-field = #START.