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

Array declaration syntax

Status
Not open for further replies.

KidFix

Programmer
Feb 7, 2002
60
US
Hi

I'm trying to declare an array in a formula field, but I can't seem to get the syntax correct. Here's what I've got:

NumberVar MonthLookup := MakeArray[0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];

which raises an error saying there is a ']'missing.

Thanks in advance
 
I think what you really want is this:

NumberVar Array MonthLookup := MakeArray(0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);

Nest pas?

Naith
 
Thanks that worked a treat. Wasn't the syntax given in the help file though!?
 
Kidfix,

I think you are referring to the following:

NumberVar MonthLookup := [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];

The use of MakeArray() is not required in this situation, although either formula works. Software Training and Support for Macola, Crystal Reports and Goldmine
714-348-0964
dgilsdorf@mchsi.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top