I have a few programs as below:
Program id: onkey.4gh
--------------------------------
....
....
on key (F8) let g_onkey = 8
....
Program id: hotkeys.h
------------------------------
....
#define F8_KEY 8
.....
Main Program id: Prog.4gl
-------------------------------------
#include hotkeys.h
Function input_scr()
display form
input array arr1 without defaults from sa_arr1
......
.....
#include "onkey.4gh"
case
when (g_hotkey = F8_KEY)
call generate_rpt()
end case
......
End Function
Problem:
------------
I wish to automate this INFORMIX 4GL program by passing in the input values
as an arguments from a calling unix scripts.
The sequence INFORMIX 4GL screen input will be as below:
1. enter screen array with 2 fields - account No, account name
e.g of the input screen will be
Account No Account Name
[A ] [A/C Name A]
[B] [A/C Name B]
[C] [A/C Name C]
2. press F8 ctrl-key to generate the report
My unix script (korn shell) will be something as below:
ksh -c "echo <array input value><F8 ctrl-key> |/proj/prog.exe " << ^M
!
Note: /proj/prog.exe is my INFORMIX-4GL executable.
Question:
1. How to pass in a set of <array input value> from the scripts to an
informix 4GL program?
2. The input array are optional, user can enter value in the array or just
leave the entry empty and press F8 to proceed with the process. In this case,
how to pass in an empty array values from a unix script (korn shell) to an
Informix-4GL program?
I am facing this problem and need resolution urgently, please.
I will be glad if anyone can help me on this issue.
Thanks in advacne.
--
Mike Aubury
I am not too sure what you meant, could you please explain further how to do
it?
You can use your script file to set some envirenment variables, and
then use fgl_getenv() to bring the information into the 4gl program.
Thanks for you reply.
But then I can't modify the 4gl program in this case which my boss won't
allow me to do so. All I have to do is only pass in the values from script
itself to the 4GL program in order to automate the process.
Any idea to resolve this?
Please help it is urgent.
To do all this you have various options in re directing the input and out
put of programs in Unix.
Thanks again for your prompt reply.
The unix script that I am writting is NOT to test my 4GL program. It is help
to automate our process during batch run.
Sorry, I am very expert in unix shell programming, do you might providing
some examples how it works as you explain earlier.
e.g capturing key stores, re-directing the input and output and so on...
I know I am asking too much, but I have no clue as this moment as the
schedule is tight. I am still working on it right now and search for the
resolution.
Once again thanks in advance for your help.
http://staf.sourceforge.net/index.php
HTH
Mario R. Canto
Thank you very much for your valuable advise from Mario R. Canto and mehdi2.
I have now able to capture all the keystroke. But still have 1 problem as
describe below:
My 4GL program have 2 screens to prompt user for input:
1st screen:
prompt for date1 and date2
2nd screen:
prompt for input array for account no and name and press F8 to process. For
the 2nd screen, the input is optional, user can just leave the entry blank
and press F8 to proceed.
The problem occured and it stopped at the 2nd screen whereby the 4GL program
was calling the tcflush function before the input array.
I am not so sure about the tcflush functionality but found some knowledge
thru internet:
***** tcflush description start*******
tcflush - flush non-transmitted output data, non-read input data or both.
DESCRIPTION
Upon successful completion, tcflush() discards data written to the object
referred to by fildes (an open file descriptor associated with a terminal)
but not transmitted, or data received but not read, depending on the value of
queue_selector:
If queue_selector is TCIFLUSH it flushes data received but not read.
......
Attempts to use tcflush() from a process which is a member of a background
process group on a fildes associated with its controlling terminal, will
cause the process group to be sent a SIGTTOU signal. If the calling process
is blocking or ignoring SIGTTOU signals, the process is allowed to perform
the operation, and no signal is sent.
***** tcflush description end*******
Note: there are a few queue_selector, but we are using TCIFLUSH in my 4GL
program.
I have tried commented the calling function of TCIFLUSH in my 4GL program,
and my script is working totally fine. However, my boss has given the
instruction not to modify any 4GL program. So, anyone has any clue to resolve
this?
My unix script is as below:
ksh -c "echo 31/08/2005 31/08/2005^M^M$(tput kf8)|/proj/prog.exe" <<!
^M
!
Is there anywhere to include a pause in echo before the 2nd parameters
passing in to my 4gl program in unix script?
e.g
ksh -c "echo 31/08/2005 31/08/2005^M^M <anywhere to include a Pause in
between here > $(tput kf8)|/proj/prog.exe" <<!
^M
!
Thank you.
--
Message posted via http://www.dbmonster.com
script :
# sometab : create table sometab (pid integer,col1 char(10),col2 char(20));
echo "insert into sometable values($$,'xx1','yy1')" | dbaccess somedb -
echo "insert into sometable values($$,'xx2','yy2')" | dbaccess somedb -
echo "insert into sometable values($$,'xx3','yy3')" | dbaccess somedb -
# rds :
fglgo someprog $$
# c4gl/aubit
someprog $$
someprog.4gl
main
define lv_arr array[200] of record
x char(10),
y char(20)
end record
define lv_cnt integer
define lv_pid integer
let lv_pid=arg_val(1)
let lv_cnt=1
declare c1 cursor for
select col1,col2 from sometab where pid=lv_pid
foreach c1 into lv_arr[lv_cnt].*
let lv_cnt=lv_cnt+1
end foreach
let lv_cnt=lv_cnt-1
call set_count(lv_cnt)
input array ...
On Friday 05 May 2006 07:56, Mike Aubury wrote:
> If it were me - I'd load a table in the database with the values, probably
> using the process ID of the script as a key.
> Then pass that process ID into the 4gl program where it looks those values
> up...
>
> On Friday 05 May 2006 07:51, yy4 wrote:
> > _______________________________________________
> > Informix-list mailing list
> > Inform...@iiug.org
> > http://www.iiug.org/mailman/listinfo/informix-list
--
Mike Aubury
HTH
Mario R. Canto
>_______________________________________________
>Informix-list mailing list
>Inform...@iiug.org
>http://www.iiug.org/mailman/listinfo/informix-list
--
Ing. Mario R. Canto
mrc...@gmail.com
Mario R. Canto
Hi Mario,
I have tried to put a sleep, but it is not working too. Any other clue to
resolve this ?
--
Message posted via DBMonster.com
http://www.dbmonster.com/Uwe/Forums.aspx/informix/200605/1