Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Resizing a dynamic array

168 views
Skip to first unread message

john.and...@gmail.com

unread,
May 15, 2013, 2:59:19 AM5/15/13
to
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

john.and...@gmail.com

unread,
May 15, 2013, 3:02:37 AM5/15/13
to
Sorry forgot to mention OS: RHELv6.3

Marco Greco

unread,
May 15, 2013, 5:11:55 AM5/15/13
to inform...@iiug.org


On 15/05/13 07:59, john.and...@gmail.com wrote:
> 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
> _______________________________________________
> Informix-list mailing list
> Inform...@iiug.org
> 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

john.and...@gmail.com

unread,
May 20, 2013, 12:34:17 AM5/20/13
to
On Wednesday, May 15, 2013 5:11:55 PM UTC+8, Marco Greco wrote:
>
> 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
0 new messages