I have the following code that I am using to build a string based on values of an array:
local stringVar array a :=
{@Dept_Array};
local numbervar b:=1;
Global Stringvar DeptString;
for b:=1 to ubound(a)
do
if left(a,7) = "5000001"
then DeptString:= DeptString + 'Public Consulting Group' + chrw(13)
else if left(a,7) = "5000002"
then DeptString:= DeptString + 'Health And Human Services' + chrw(13)
else if left(a,7) = "5000006"
then DeptString:= DeptString + 'Education' + chrw(13)
else if left(a,7) = "5000008"
then DeptString:= DeptString + 'Corporate ' + chrw(13)
else if left(a,7) = "5000012"
then DeptString:= DeptString + 'IT' + chrw(13)
else if left(a,7) = "5000741"
then DeptString:= DeptString + 'CRM' + chrw(13)
else if left(a,7) = "5000961"
then DeptString:= DeptString + 'Technology Consulting' + chrw(13)
else
DeptString := 'Corporate' + cstr(ubound(a)) + chr(13) + chr(10) +
'Education' + chr(13) + chr(10) +
'Enterprise Architecture Solutions' + chr(13) + chr(10) +
'Enterprise Program Services' + chr(13) + chr(10) +
'Enterprise Technology Solutions' + chr(13) + chr(10) +
'Health & Human Services' + chr(13) + chr(10) +
'IEP Online' + chr(13) + chr(10) +
'IT' + chr(13) + chr(10) +
'LTI' + chr(13) + chr(10) +
'Pacific North West' + chr(13) + chr(10) +
'Project Management Solutions' + chr(13) + chr(10) +
'Public Consulting Group' + chr(13) + chr(10) +
'Quality Solutions' + chr(13) + chr(10) +
'Technology Consulting';
DeptString
But for some reason if the
{@Dept_Array} has more than one value then the DeptString only shows the value that fulfills the if/else statement first. It won't show more than one department only the one that hits first. I need it to build a output string with all the values inside the
{@Dept_Array}