Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

'in array' and 'redim preserve'

Status
Not open for further replies.

ramkrish11

Programmer
Oct 7, 2005
25
US
I am using Crystal REports XI and have a problem with arrays.

We have customer_ids and account_ids. You can have multiple account_ids for each customer id. I need to 0 out some the numeric values when account ids are repeated for a customer. yes. it is sorted as needed.


I am trying to accomplish this by creating an array of account_ids for each customer as i print it.

when the customer changes I redim the array and start over.
otherwise I search in the array and set a flag if found
if not found, add in the array and continue

2 issues.

1. This array wont grow more than 2 using 'redim preserve'
2. 'in array' never succeeds; returns False and adds the same value twice

i will appreciate it if Anyone can shed some light and sense into this.

Thanks a ton
 
I think you're going to have to share the formulas you have created.

-LB
 
thanks for your input...

there is nothing that can be solved by a day of headbanging :)

Seems we have to specify the "in array" as

"variable in arrayname[1 to i]" i being the upperbound on the array

I was specifying it as

"variable in arrayname "

which is more intuitive..

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top