Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to check the Informix-4gl - on key (Accept) Value 1

Status
Not open for further replies.

yy2

MIS
May 3, 2006
10
US
Let me explain a bit of the backgroud before I post my question:

Inside the informix 4gl program

OPTIONS INPUT WRAP

OPTIONS INSERT KEY F2
OPTIONS NEXT KEY F3
OPTIONS PREVIOUS KEY F4
OPTIONS DELETE KEY F8
OPTIONS ACCEPT KEY F9

.....
....

Function input_scr
display form

input ....

on key (ACCEPT)
call generate_rpt()

End Function

Problem:
How to get the value of "on key (ACCEPT)which is equivalent to F9 key"?

The reason why I need the F9 key value is because I am actually need this value to be pass in as an argument in my unix script which is calling this program?

My unix script (korn shell) will be something as below:

Assuming my input will be date1 and date2 and finally need to press F9 to process:
date1 = 31/05/2006
date2 = 1/06/2006
Process path/process = /proj/prog.exe

ksh -c "echo 31/05/20061/06/2006<F9 ctrl-key> |/proj/prog.exe " << ^M
!

I will be glad if anyone can help me on this issue.
Thanks in advacne.

 
You may try this:
ksh -c "echo 31/05/20061/06/2006[!]$(tput kf9)[/!] |/proj/prog.exe "

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thank you for your help, it is working perfectly fine.

I have another similar issue but the informix-4GL was written in a different way as below:

Program id: onkey.4gh
....
....
on key (F9) let g_onkey = 9


Program id: hotkeys.h
#define F9.key 9
.....

Program id: Prog.4gl
#include hotkeys.h

Function input_scr
display form

input ....

#include "onkey.4gh"
case
when (g_hotkey = F9_KEY)

call generate_rpt()

End Function

Question:
If am passing the argument similar to the above as describe, what should be the F9 control key, can the $(tput kf9) be used in this case?


ksh -c "echo 31/05/20061/06/2006<F9 ctrl-key> |/proj/prog.exe " << ^M
!

Thanks.


 
I have an additional queries:

What would be the argument values to be pass from the unix script to the 4gl program if the 4gl program require input array?

e.g

ksh -c "echo <input array><F9 ctrl-key>|/proj/prog.exe" <<^M !

The possible input array to be pass in are as below:
1. Input array for 2 fields
e.g
account1 account name 1
account2 account name 2
account3 account name 3
and so on
2. Blank - do not pass in anything

Please help.

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top