Re: 4gl question
Posted in 1998
I have the similar problems.
this shar archive contains simulation of problems with attributes in
input.
Warning: my english is poor !
#---------------------------------- cut here
----------------------------------
# This is a shell archive. Remove anything before this line,
# then unpack it by saving it in a file and typing "sh file".
#
# Wrapped by Jiri Lisicky <lisicky@datis.cdrail.cz> on Fri Sep 11
09:24:26 1998
#
# This archive contains:
# README.TXT color.4gl color1.per color2.per
# compile
#
# Error checking via wc(1) will be performed.
LANG=""; export LANG
PATH=/bin:/usr/bin:/usr/sbin:/usr/ccs/bin:$PATH; export PATH
echo x - README.TXT
cat >README.TXT <<'@EOF'
Simulation of error "display with attributes."
Testing enviroment:
INFORMIX-4GL Version 6.04.UC1 (6.03.UC1 is ok)
Pcode Version 602
HP-UX B.10.10 U 9000/887 (I think that this is not matter)
Description of error:
Is not possible to display two fields with different attributes in
one
INPUT.
When return from other form, all fields are display in input
attributes
*test1*
When program start up, field1 is display in input attributes
(default
white). This is wrong - field attributes are different
*test2*
Uncomment OPTIONS INPUT ATTRIBUTE on lines 7 and 8.
When program start up, all is ok (because field attributes are the
same
as the input attributes). When go into field2, green attribute is
lost
and field is displaying in attributes specified in OPTIONS
statement.
*test3*
On field1 press F5 key. In second testing form press ACCEPT (esc)
to
return. All fields in first form is redisplayed in input
attrubutes.
@EOF
set `wc -lwc <README.TXT`
if test $1$2$3 != 30147980
then
echo ERROR: wc results of README.TXT are $* should be 30 147
980
fi
chmod 640 README.TXT
echo x - color.4gl
cat >color.4gl <<'@EOF'
MAIN
OPTIONS
INPUT WRAP
# For test2
OPTIONS
INPUT ATTRIBUTE (GREEN, REVERSE)
CALL input_c1 ()
END MAIN
FUNCTION input_c1 ()
DEFINE
lr_input RECORD
field1 CHAR(10),
field2 CHAR(10),
field3 CHAR(10)
END RECORD
LET lr_input.field1 = "field1"
LET lr_input.field2 = "field2"
LET lr_input.field3 = "field3"
OPEN WINDOW w_color1
AT 4,4
WITH FORM "color1"
ATTRIBUTES (BORDER,
FORM LINE 1)
INPUT
lr_input.field1,
lr_input.field2,
lr_input.field3
WITHOUT DEFAULTS
FROM
field1,
field2,
field3
BEFORE INPUT
DISPLAY BY NAME lr_input.field1 ATTRIBUTE (GREEN, REVERSE)
DISPLAY BY NAME lr_input.field2 ATTRIBUTE (GREEN)
DISPLAY BY NAME lr_input.field3 ATTRIBUTE (GREEN, REVERSE)
ON KEY (F5)
CALL input_c2 ()
END INPUT
CLOSE WINDOW w_color1
END FUNCTION
#-----------------------------------------------------------------------------
FUNCTION input_c2 ()
DEFINE
lr_input RECORD
field1 CHAR(10),
field2 CHAR(10),
field3 CHAR(10)
END RECORD
LET lr_input.field1 = "other1"
LET lr_input.field2 = "other2"
LET lr_input.field3 = "other3"
OPEN WINDOW w_color2
AT 4,40
WITH FORM "color2"
ATTRIBUTES (BORDER,
FORM LINE 1)
INPUT
lr_input.field1,
lr_input.field2,
lr_input.field3
WITHOUT DEFAULTS
FROM
field1,
field2,
field3
BEFORE INPUT
DISPLAY BY NAME lr_input.field1 ATTRIBUTE (GREEN)
DISPLAY BY NAME lr_input.field2 ATTRIBUTE (GREEN, REVERSE)
DISPLAY BY NAME lr_input.field3 ATTRIBUTE (GREEN)
END INPUT
CLOSE WINDOW w_color2
END FUNCTION
@EOF
set `wc -lwc <color.4gl`
if test $1$2$3 != 911791727
then
echo ERROR: wc results of color.4gl are $* should be 91 179
1727
fi
chmod 640 color.4gl
echo x - color1.per
cat >color1.per <<'@EOF'
DATABASE FORMONLY
SCREEN
{
First testing form
\\g--------------------------\\g
[f1 ] GREEN REVERSE
[f2 ] GREEN
[f3 ] GREEN REVERSE
\\g--------------------------\\g
ON KEY F5 CALL FORM 2
ON KEY ACCEPT EXIT
}
ATTRIBUTES
f1 = FORMONLY.field1;
f2 = FORMONLY.field2;
f3 = FORMONLY.field3;
@EOF
set `wc -lwc <color1.per`
if test $1$2$3 != 2141300
then
echo ERROR: wc results of color1.per are $* should be 21 41
300
fi
chmod 640 color1.per
echo x - color2.per
cat >color2.per <<'@EOF'
DATABASE FORMONLY
SCREEN
{
Second testing form
\\g--------------------------\\g
[f1 ] GREEN
[f2 ] GREEN REVERSE
[f3 ] GREEN
\\g--------------------------\\g
ON KEY ACCEPT EXIT
}
ATTRIBUTES
f1 = FORMONLY.field1;
f2 = FORMONLY.field2;
f3 = FORMONLY.field3;
@EOF
set `wc -lwc <color2.per`
if test $1$2$3 != 2034272
then
echo ERROR: wc results of color2.per are $* should be 20 34
272
fi
chmod 640 color2.per
echo x - compile
cat >compile <<'@EOF'
#!/bin/sh
form4gl color1.per
form4gl color2.per
fglpc color.4gl
mv color.4go color.4gi
@EOF
set `wc -lwc <compile`
if test $1$2$3 != 61088
then
echo ERROR: wc results of compile are $* should be 6 10 88
fi
chmod 750 compile
exit 0
--
Ji'' Lisick' 'D DATIS Olomouc
e-mail: lisicky@datis.cdrail.cz Nerudova 1
phone: +420-068-472-5496 Olomouc, Czech Republic
>>> 'e'tina ISO-8859-2 Compatible <<<