Newsgroups: comp.databases.informix
From: neil@salmon.demon.co.uk ("Neil S. Briscoe")
Subject: Why does this not work on one machine?
Date: Fri, 28 Aug 1992 14:32:41 +0000

I have an appointment entry routine as part of our medical database
and, on the whole, it works fine.  However, there is one section of
code (in an ON KEY clause of the INPUT ARRAY command) that works fine
on two machines and simply does nothing on the other.  It doesn't core
dump, it doesn't crash or hang the machine, simply, nothing happens.
Afterwards, you can use any of the other functions without problems.

Here is the section of 4GL code

	ON KEY (CONTROL-O)
	DISPLAY FORM sptq_frm_
	CALL short_query("Y", "N")
	CALL make_pat_name()
	CALL disp_patient()
	DISPLAY FORM add_appt_frm_
	DISPLAY diary_.* TO sc_find.*
	CALL disp_instruct()
	EXIT INPUT

At the point where this code is called, the form "add_appt_frm_" is on
the screen.  This code calls up a patient enquiry screen, allows a new
patient to be selected and then redisplays the appointment booking
screen.

Below I have included the platforms and appropriate code from the .ec
files from each platform.  As can be seen, there are no major
differences other than can be accounted for by the different engine
versions.

Here is the code that doesn't work:  Platform: Sun 3/60 SunOS 4.1.1
INFORMIX-4GL Version 4.00.UD3, Standard Engine Version 4.00.UD4

$  on key ( control - o );
$  display form sptq_frm_;
status = efcode;

{
int fgl_svstk, fgl_nret;
fgl_svstk = mark_stack();
_expcode = 0;
pushquote( "Y" , 1);
pushquote( "N" , 1);
status = _expcode;
fgl_nret = short_query(2);
rest_stack(fgl_svstk);
$input set;
}

{
int fgl_svstk, fgl_nret;
fgl_svstk = mark_stack();
_expcode = 0;
status = _expcode;
fgl_nret = make_pat_name(0);
rest_stack(fgl_svstk);
$input set;
}

{
int fgl_svstk, fgl_nret;
fgl_svstk = mark_stack();
_expcode = 0;
status = _expcode;
fgl_nret = disp_patient(0);
rest_stack(fgl_svstk);
$input set;
}
$  display form add_appt_frm_;
status = efcode;
$  display $diary_.page_date , $diary_.dow , $diary_.cam_code to sc_find . *;
status = efcode;

{
int fgl_svstk, fgl_nret;
fgl_svstk = mark_stack();
_expcode = 0;
status = _expcode;
fgl_nret = disp_instruct(0);
rest_stack(fgl_svstk);
$input set;
}
$  exit input;

Here is the code from a Sun 3/280 running SunOS 3.5 (how old?!)
running 4GL 2.10.00B

$  on key ( control - o );
$  display form sptq_frm_;
status = efcode;

{
int fgl_svstk, fgl_nret;
fgl_svstk = mark_stack();
pushquote("Y", 1);
pushquote("N", 1);
fgl_nret = short_query(2);
rest_stack(fgl_svstk);
}

{
int fgl_svstk, fgl_nret;
fgl_svstk = mark_stack();
fgl_nret = make_pat_name(0);
rest_stack(fgl_svstk);
}

{
int fgl_svstk, fgl_nret;
fgl_svstk = mark_stack();
fgl_nret = disp_patient(0);
rest_stack(fgl_svstk);
}
$  display form add_appt_frm_;
status = efcode;
$  display $diary_.page_date , $diary_.dow , $diary_.cam_code to sc_find . *;
status = efcode;

{
int fgl_svstk, fgl_nret;
fgl_svstk = mark_stack();
fgl_nret = disp_instruct(0);
rest_stack(fgl_svstk);
}
$  exit input;

And finally, the code from a Sun Sparc 4/330 running SunOS 4.1.2 with
4GL version 4.10.UC1 with standard engine 4.10.UC2

$  on key ( 15 );
_anyerr = 0;
$  display form sptq_frm_;
status = efcode;

{
int fgl_svstk, fgl_nret;
fgl_svstk = mark_stack();
pushquote( "Y" , 1);
pushquote( "N" , 1);
fgl_nret = short_query(2);
rest_stack(fgl_svstk);
_anyerr = 0;
$input set;
}

{
int fgl_svstk, fgl_nret;
fgl_svstk = mark_stack();
fgl_nret = make_pat_name(0);
rest_stack(fgl_svstk);
_anyerr = 0;
$input set;
}

{
int fgl_svstk, fgl_nret;
fgl_svstk = mark_stack();
fgl_nret = disp_patient(0);
rest_stack(fgl_svstk);
_anyerr = 0;
$input set;
}
$  display form add_appt_frm_;
status = efcode;
$  display $diary_.page_date , $diary_.dow , $diary_.cam_code to sc_find . *;
status = efcode;

{
int fgl_svstk, fgl_nret;
fgl_svstk = mark_stack();
fgl_nret = disp_instruct(0);
rest_stack(fgl_svstk);
_anyerr = 0;
$input set;
}
$  exit input;

As you can see, apart from the existance of certain variables in one
version and not another, there is no significant difference.  Any one
any idea how to re-code this to make it work on all three?

Thanks for any and all suggestions.

Regards
Neil

Neil S. Briscoe				Telephone: +44 252 376737
System Administrator			Fax:       +44 252 376644
                                        Email: neil@salmon.demon.co.uk
                                               nbriscoe@cix.compulink.co.uk
Bartec Medical Systems Ltd.
Impression House
Invincible Road				"!##@!** Listen who swears
Farnborough				Christopher Robin has fallen downstairs"
Hants GU14 7NP				-- The Goodies Book of Criminal Records
England
"A man is incomplete until he's married -- then he's finished!"
-- seen on a desktop calendar