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

Extracting discreet values from multiple value parameters 2

Status
Not open for further replies.

Davest11

Programmer
Oct 26, 2004
82
US
I'm using CR v10, SP 3. Is there a way to extract the individual values from a multiple value parameter? For instance, I have a string parameter that allows the user to enter either multiple discreet values or range values. Is there a way in which I can check how many characters are in the first entry? If I use

length (<parameter>)

I get the "string required" error message, because the parameter is actually an array. I tried using a subscript, but that doesn't work at all (ok, I *knew* it wouldn't be that easy).

Thanks,

-Dave
 
If you wanted to display all selected parameter values, you would use a formula like:

whileprintingrecords;
string range array parm := {?rangeorindivparm};
numbervar i;
numbervar j := ubound(parm);
stringvar display;

for i := 1 to j do(
display := display +
if minimum(parm) = maximum(parm) then
minimum(parm) else
minimum(parm) + " to " + maximum(parm) + ", "
);
left(display,len(display)-2);

Not sure if this is why you were asking, but you could adapt this to other purposes.

-LB
 
Thanks, LB - this is axactly what I was looking for. I knew that the parameter was actually an array, but I couldn't come up with a way in which I could interact with it as you can with an array variable. It didn't cross my mind to try to apply the parameter to an array variable and then manipulate the variable.

Thanks,

-Dave
 
Here's my FAQ on extracting values from parameters:

faq767-5684

Covers most types.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top