I've got the following in the active4D.a4l library:

method "On Application Start"
        `need to create the global collection, cFormSelects, for forms

                cFormSelects:=new global collection

                array string(255;$aReqTypes;0)
                set array($aReqTypes;"Medical", "School Business", "Personal", "Comp.",
"Funeral")
                cFormSelects{"ReqTypes"}:=$aReqTypes

end method

I've got another library "mylib.a4l" with this:

method "BuildSelect" ($selectNameToUse; $inAttributeName)

C_Text($result)
$result:=""
C_Longint($i)

for($i;1;size of array(cFormSelects{$selectNameToUse)))
        If (cFormSelects{$selectNameToUse}{$i}=$attributes{$inAttributeName})
        $result:=$result+"<option value
selected="+cFormSelects{$selectNameToUse}{$i}+">"

        else
        $result:=$result+"<option value="+cFormSelects{$selectNameToUse}{$i}+">"
        end if
end for


return($result)

end method

I get the following error when i execute

<% import("willsub") %>
<%=cFormSelects{"ReqTypes"}{1} %>

Active4D error
Unknown identifier.
=cFormSelects{"ReqType"}{1}

the cFormSelects is red.

I think I have a collection scope problem, but I've run out of things to
try.
Anything obvious to you other active4d'ers?

Thanks,
Mike Vogt
Millennium Data Services, Inc.
(989) 786-4848
[EMAIL PROTECTED]


Reply via email to