Page 1 of 1

Arithmetic operation into an array subscript

PostPosted: Tue Jan 26, 2010 1:08 am
by Rod
can you put an arithmetic operation into an array subscript or do you have to do it in 2 instructions.
adults = adults + 1
subx = adults * 150
move indata to array((adults * 150) + 53) or
move indata to array(subx + 53)
move salary to array(subx + 60)
or do you have to have the subx calc before every move
subx = adults * 150 +53
move indata to array(subx)
subx = adults * 150 + 60
move salary to array(subx)

seems like a lot of wasted code/space

Re: array subscript

PostPosted: Tue Jan 26, 2010 1:41 am
by dick scherrer
Hello,

What happened when you tried it? If you haven't tried it, do so and see what happens.

seems like a lot of wasted code/space
We kinda have to use the products as they are delivered :)

CA welcomes feedback for new/enhanced features. . .

Re: array subscript

PostPosted: Tue Jan 26, 2010 1:47 am
by Rod
I would get compile errors like items not defined, highlighting items in the subscript until I did the 2 instructions, then I had to insert the 2 instructions everywhere. Just did not seem right.

Re: array subscript

PostPosted: Tue Jan 26, 2010 1:54 am
by dick scherrer
Hello,

Just did not seem right.
Yup, but it has been this way for a long time. . .

Re: array subscript

PostPosted: Tue Jan 26, 2010 3:26 pm
by GuyC
wouldn't it be easier to have a two dimensional array?

Re: array subscript

PostPosted: Tue Jan 26, 2010 3:27 pm
by GuyC
oops, thought this was cobol, don't know anything about easytrieve , so ignore my remark

Re: Arithmetic operation into an array subscript

PostPosted: Wed Jan 27, 2010 1:50 am
by dick scherrer
Hi Guy,

Not to worry :)

Also, Easytrieve does support multi-dimensional arrays.