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

Upper Bound Definition - how it works

Status
Not open for further replies.

JICDB

Technical User
Apr 7, 2004
15
0
0
US
First I would like to thank all of you selfless people who help others such as myself who are struggling with programming/software issues. My company is either too cheap or network problems have prevented them from installing help for Crystal reports on my computer so I come here often to search the posts and FAQs.

I have Crystal 8.5. I have a parameter for date which allows multiples. I am attempting to create 10 formula fields which are assigned to each date selected in the parameter array. I found some great help from SBendBuckeye (Programmer) who posted the following formula to define a variable:

BeforeReadingRecords;
Local NumberVar Index;
Local StringVar Result;
Local NumberVarArray NumArray:= {?AccountNumber};
UBound (NumArray);
For Index :=1 To UBound(NumArray) Do
(Result:=Result + ToText(Int({?AccountNumber}[Index])) + ",");

Result

I am new to programming and would love it if someone could explain what a Ubound is and how it works. The way I have the report set up it works but only if there is a date for all 10 fields. If the user selects only 3 dates I get a subscript error.

Thanks again for all of your support.
[ponytails2]
 
There's a known issue with installing the help file in 8.5, and you can D/L help files for your desktop use.

I won't bother looking up the links, it's posted dozens of times here, or check the BO site.

Ubound is the number of elements in the array.

Rather than his formula, just use:

split({?mystringarray},",")

-k
 
Thanks - I'll give it a try.
[ponytails2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top