Arithmetic operation into an array subscript



Unicenter CA-Easytrieve Plus Report Generator: CA's information retrieval and data management tool

Arithmetic operation into an array subscript

Postby Rod » Tue Jan 26, 2010 1:08 am

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
Rod
 
Posts: 9
Joined: Fri Oct 30, 2009 1:53 am
Has thanked: 0 time
Been thanked: 0 time

Re: array subscript

Postby dick scherrer » Tue Jan 26, 2010 1:41 am

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. . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: array subscript

Postby Rod » Tue Jan 26, 2010 1:47 am

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.
Rod
 
Posts: 9
Joined: Fri Oct 30, 2009 1:53 am
Has thanked: 0 time
Been thanked: 0 time

Re: array subscript

Postby dick scherrer » Tue Jan 26, 2010 1:54 am

Hello,

Just did not seem right.
Yup, but it has been this way for a long time. . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: array subscript

Postby GuyC » Tue Jan 26, 2010 3:26 pm

wouldn't it be easier to have a two dimensional array?
GuyC
 
Posts: 315
Joined: Tue Aug 11, 2009 3:23 pm
Has thanked: 1 time
Been thanked: 4 times

Re: array subscript

Postby GuyC » Tue Jan 26, 2010 3:27 pm

oops, thought this was cobol, don't know anything about easytrieve , so ignore my remark
I can explain it to you, but i can not understand it for you.
GuyC
 
Posts: 315
Joined: Tue Aug 11, 2009 3:23 pm
Has thanked: 1 time
Been thanked: 4 times

Re: Arithmetic operation into an array subscript

Postby dick scherrer » Wed Jan 27, 2010 1:50 am

Hi Guy,

Not to worry :)

Also, Easytrieve does support multi-dimensional arrays.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to CA-Easytrieve

 


  • Related topics
    Replies
    Views
    Last post