cancel
Showing results for 
Search instead for 
Did you mean: 

create an array using various field values

Former Member
0 Kudos

Folks,

could do with a quick pointer in the right direction.

I've got 30 currency fields held at the detail level of a report. I'm trying to pull out only those values that have a value. I thought the best way would be to use an array......

Field1: £0.00

Field2: £0.00

Field3: £10.00

Field4: £2.00

Field5: £0.00

Field6: £1.00

etc.

So, I need to pull out Field3: £10.00; Field4: £2.00; Field6: £1.00...both the field value and its position in the array.

cheers,

dom

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

in addition.....

Former Member
0 Kudos

no worries,

i've sussed it....

local numbervar counter;
local numbervar i:=1;
local stringvar str:="";
local currencyvar array X:=[{Field1},{Field2},{Field3},{Field4},{Field5}];
for counter := 1 to 5 do

(if X[Counter]>$0 then
str:=str + cstr(counter) + " - " +cstr(X[counter])+ "   "
);
str

Former Member
0 Kudos

in addition.....

this will return a string of various length of the format:

1 - X[1] 2 - X[2] 3 - X[3]

depending how many values in the array are > than $0

is there any way to either format the output like such:

1 - X[1] 2 - X[2] 3 - X[3]

and/or

insert a carriage return between each part:

1 - X[1]

2 - X[2]

3 - X[3]

........thought about either HTML or using Chr13 but not sussed it yet.

ideas?

cheers,

Dom