User command in @key processing
Kenneth Brody
kenbrody at spamcop.net
Mon Aug 13 11:15:11 PDT 2018
On 8/13/2018 2:02 PM, James Flanagan via Filepro-list wrote:
> Filepro 5.8.01.06D6
> Redhat Exnterprise 6.8
>
> /bin/test_script
> echo 23
>
> Input processing
> ::end:
> ::’:
> @keyx::’:
> ::aa(2,.0):
> ::user xxx = /bin/test_script
> ::aa=xxx:
> ::msgbox aa:
> ::end:
>
> The first iteration of this code, when hitting the “X” key works and the
> msgbox contains “23”. Every subsequent time, however, the msgbox is
> blank.
>
> I found the following in the manual, but I am not quite certain that this
> is the issue. IMPORTANT: When reading from a user program, filePro Plus
> executes the program only once, not over and over. Therefore, make sure
> the user program itself loops until it reaches an end-of-file.
>
> Can input processing keep re-running a user command each time in @key
> processing, however many times the key is pressed for a given record.
If you want filePro to restart the user program, you'll need to CLOSE it
from within filePro.
user xxx = /bin/test_script
aa = xxx
close xxx
mesgbox aa
Or, better yet, have the script loop, and have filePro send it something
every time you want to read from it:
Script:
while read junk
do
date
done
Processing:
user xxx = /bin/test_script
xxx = "" ; aa = xxx
mesgbox aa
--
Kenneth Brody
---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
More information about the Filepro-list
mailing list