Discussion:
Resizing a dynamic array
(too old to reply)
j***@gmail.com
2013-05-15 06:59:19 UTC
Permalink
Hi guys,

I'm having problems resizing a multidimensional dynamic array. Resizing a single dimension dynamic array works as expected though.

/home/user1>cat test.4gl
main
define l_dyn dynamic array with 2 dimensions of char(9)
allocate array l_dyn[2,2]
resize array l_dyn[3,2]
end main
/home/user1>c4gl test.4gl
test.ec: In function âmainâ:
test.ec:94: error: expected declaration or statement at end of input

Opening up test.ec I can see that the first ibm_lib4gl_getExtentSize is missing a closing curly bracket

-----------------------
{ <-- No closing bracket for this
int4 _fglidx2 = ibm_lib4gl_getExtentSize(l_dyn, 0, 1);

{
int4 _fglidx3 = ibm_lib4gl_getExtentSize(l_dyn, 0, 2);
ibm_lib4gl_resizeDynArrC(l_dyn, 0, 3, 2, 0);

{
int4 _fglidx4;
for (_fglidx4 = _fglidx2 + 1; _fglidx4 <= ibm_lib4gl_getExtentSize(l_dyn, 0, 1); _fglidx4++)

{
int4 _fglidx5;
for (_fglidx5 = _fglidx3 + 1; _fglidx5 <= ibm_lib4gl_getExtentSize(l_dyn, 0, 2); _fglidx5++)

{
ibm_lib4gl_setNullQuotedStr((int1 *) ibm_lib4gl_getElementAddressC(l_dyn, 0, _fglidx4, _fglidx5, 0), 10);
}
}
}
} <-- If I add a closing bracket after this line it compiles and works
-----------------------

Am I doing something wrong? Can't find much documentation on resizing a multidimensional dynamic array but since allocate works I assume it should work the same for resize. There's also no error identified in the 4gl code, the error is in the generated .ec file.

IBM INFORMIX-4GL Version 7.50.FC5
IBM/Informix C++ API 3.70.FC4
IBM/Informix EMBEDDED SQL for C Version 3.70.FC4
IBM Informix Dynamic Server Version 11.70.FC4


Thanks in advance,
John
j***@gmail.com
2013-05-15 07:02:37 UTC
Permalink
Sorry forgot to mention OS: RHELv6.3
Marco Greco
2013-05-15 09:11:55 UTC
Permalink
Post by j***@gmail.com
Hi guys,
I'm having problems resizing a multidimensional dynamic array. Resizing a single dimension dynamic array works as expected though.
/home/user1>cat test.4gl
main
define l_dyn dynamic array with 2 dimensions of char(9)
allocate array l_dyn[2,2]
resize array l_dyn[3,2]
end main
/home/user1>c4gl test.4gl
test.ec:94: error: expected declaration or statement at end of input
Opening up test.ec I can see that the first ibm_lib4gl_getExtentSize is missing a closing curly bracket
-----------------------
{ <-- No closing bracket for this
int4 _fglidx2 = ibm_lib4gl_getExtentSize(l_dyn, 0, 1);
{
int4 _fglidx3 = ibm_lib4gl_getExtentSize(l_dyn, 0, 2);
ibm_lib4gl_resizeDynArrC(l_dyn, 0, 3, 2, 0);
{
int4 _fglidx4;
for (_fglidx4 = _fglidx2 + 1; _fglidx4 <= ibm_lib4gl_getExtentSize(l_dyn, 0, 1); _fglidx4++)
{
int4 _fglidx5;
for (_fglidx5 = _fglidx3 + 1; _fglidx5 <= ibm_lib4gl_getExtentSize(l_dyn, 0, 2); _fglidx5++)
{
ibm_lib4gl_setNullQuotedStr((int1 *) ibm_lib4gl_getElementAddressC(l_dyn, 0, _fglidx4, _fglidx5, 0), 10);
}
}
}
} <-- If I add a closing bracket after this line it compiles and works
-----------------------
Am I doing something wrong? Can't find much documentation on resizing a multidimensional dynamic array but since allocate works I assume it should work the same for resize. There's also no error identified in the 4gl code, the error is in the generated .ec file.
IBM INFORMIX-4GL Version 7.50.FC5
IBM/Informix C++ API 3.70.FC4
IBM/Informix EMBEDDED SQL for C Version 3.70.FC4
IBM Informix Dynamic Server Version 11.70.FC4
Thanks in advance,
John
_______________________________________________
Informix-list mailing list
http://www.iiug.org/mailman/listinfo/informix-list
Me thinks it's APAR IC89387 - contact support and request a special build
--
Ciao,
Marco
______________________________________________________________________________
Marco Greco /UK /IBM Standard disclaimers apply!

Structured Query Scripting Language http://www.4glworks.com/sqsl.htm
4glworks http://www.4glworks.com
Informix on Linux http://www.4glworks.com/ifmxlinux.htm
j***@gmail.com
2013-05-20 04:34:17 UTC
Permalink
Post by Marco Greco
Me thinks it's APAR IC89387 - contact support and request a special build
--
Ciao,
Marco
______________________________________________________________________________
Marco Greco /UK /IBM Standard disclaimers apply!
Structured Query Scripting Language http://www.4glworks.com/sqsl.htm
4glworks http://www.4glworks.com
Informix on Linux http://www.4glworks.com/ifmxlinux.htm
Many thanks

Loading...