Lokendra Kumar
2nd January 2003, 14:28
Hi All,

Happy new year to u.

Defining the dynamic array in one shot is not possible in baan. But baan provided the ALLOC.MEM() function to meet the requiremet of developers.

I would like to mentioned the lines of my report script code for better code understanding.

declaration:

long counter
string item.code(16,1) based | 1D array for 1 item code of 16
| character length

detail.1:
before.layout:

counter = counter + 1

alloc.mem(item.code, 16, counter)
item.code(16, counter) = tiitm001.item

*********
But the item code is not being saved in the variable item.code

Can any one help me

Lokendra Kumar

morpheus
2nd January 2003, 14:58
string item.code(16,1) based | 1D array for 1 item code of 16

string item.code(1,1) based

item.code(16, counter) = tiitm001.item

item.code(1,counter) = tiitm001.item

Lokendra Kumar
3rd January 2003, 06:24
Hi Morpheus.....

thanks for the soultion but problem still persists there. the problem is only with the 'string type' variable not with 'double type' variable.
Script is as under:


declaration:

double item.wise.qty(1) based

detail.1:
before.layout:

counter = counter + 1
if counter = 1 then
item.number = item.number + 1
alloc.mem(ift, 1, item.number)
ift(1, item.number) = sub.item
alloc.mem(total.qty, item.number)
total.qty(item.number) = actual.qty
else
if ift(1, item.number) = sub.item then
total.qty(item.number) = total.qty(item.number) + actual.qty
else
for i = 1 to item.number
if ift(1,i) = sub.item then
total.qty(i) = total.qty(i) + actual.qty
found = tcyesno.yes
else
if found = tcyesno.yes then
found = tcyesno.yes
else
found = tcyesno.no
endif
endif
endfor
if found = tcyesno.no then
item.number = item.number + 1
alloc.mem(ift, 1, item.number)
ift(1, item.number) = sub.item
alloc.mem(total.qty, item.number)
total.qty(item.number) = actual.qty
endif
endif
endif

In the above script im getting the value of double variable total.qty but to my suprise no value of the string variable item.code is coming.

How can i solve this problem.
thankx

morpheus
3rd January 2003, 07:10
Lokendra,
I hope after our discussion, the error is solved, and the rest of the script will also be debugged soon.

Good luck.

Lokendra Kumar
3rd January 2003, 12:49
thanks morpheus

problem got solved now.

:)