[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

RE: [sqr-users] Dynamic array addressing?



I don't think you can use a dynamic variable for an array field name, but
you can use array-add to combine those three additions into one command.

It seems like you could use a third dimension in the array.  That's not
possible, but perhaps you could restructure the first or second dimension -
then you could use a loop!  Suppose the second dimension is currently 0 - 9
and you have five columns.  You could change the occurs clause to give you
50 elements.  Then columns 1 - 5 for item 9 would be second index values 45
- 49.  Columns 1 - 5 for item 8 would be second index values 40 - 44, etc.

-----Original Message-----
From: Kevin Laroche [mailto:bydesign@magma.ca]
Sent: Thursday, July 17, 2003 10:07 AM
To: sqr-users@sqrug.org
Subject: [sqr-users] Dynamic array addressing?


Hi to all
I have inheirited some bloated code full of tidbits like this
      let Array1.col(#i,9) = Array1.col(#i,9) + 1
   and
     let Array1.col2(#i,9) = Array1.col2(#i,9) + 1
   and
     let Array1.col3(#i,9) = Array1.col3(#i,9) + 1

I could really put this report on a diet if I could code something like this

    if a variable = 1
         let $column_number = 'col'
    end-if
    if a variable = 2
         let $column_number = 'col2'
    end-if
    if a variable = 3
         let $column_number = 'col3'
    end-if

    let Array1.[$column_number](#i,9) = Array1.[$column_number](#i,9) + 1

I know you can use dynamic SQR for select where and order by.  Can it done
for arrays or
is there a better way that I have missed?

Thanks to all

Kevin LaRoche
at the Canadian Human Rights Commision
Ottawa Ontario

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users