Resizing a dynamic array
Posted in 2013
Topics: Storage & Space Management, Connectivity: ESQL/C, 4GL & Embedded SQL, Versions, Editions & End-of-Life
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
Sorry forgot to mention OS: RHELv6.3
On 15/05/13 07:59, john.anderson.ph@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 > Informix-list@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
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