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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

subscript must be between 1 and the size of the array

Status
Not open for further replies.

ncchish

Programmer
Jul 29, 2002
86
US
I'm getting this error with a formula in CR 8.5. Can anyone tell me what is wrong with this formula?

Thanks!

BooleanVar SelectRec := false;
NumberVar Counter;
Global NumberVar Array MgrSSN;
for Counter := 1 to UBound({?MgrSSN}) do
if ({AGMRV_HIERARCHY.AGT_MGR_TAX_ID_NBR} = (MgrSSN[Counter]) and {AGMRV_HIERARCHY.AGY_AGCY_NBR} = {?Agency}) then SelectRec := true;
Counter := Counter + 1;
SelectRec;
 
You haven't assigned an array to your MgrSSN variable that you are referencing in your loop.

Either assign the variable
Global NumberVar Array MgrSSN:={?MgrSSN};

or change this line:
if ({AGMRV_HIERARCHY.AGT_MGR_TAX_ID_NBR} = (MgrSSN[Counter]) and

to:
if ({AGMRV_HIERARCHY.AGT_MGR_TAX_ID_NBR} = (?MgrSSN[Counter]) and

Mike
 
Ooops
the last part of my post should have been

or change this line:
if ({AGMRV_HIERARCHY.AGT_MGR_TAX_ID_NBR} = (MgrSSN[Counter]) and

to:
if ({AGMRV_HIERARCHY.AGT_MGR_TAX_ID_NBR} = ({?MgrSSN}[Counter]) and
Mike



Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top