3초기억력

asp recursive 트리 구조 본문

플밍_ASP

asp recursive 트리 구조

잠수콩 2016. 11. 29. 17:31
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.



제목 : asp recursive 트리 구조




소스 :


<%

    function fntree(parent, arrPages)

        children = false

        for x = 0 to ubound(arrPages, 2)

phone = ""

name = ""

            if (arrPages(1, x) = parent) then

                if (children = false AND parent > "0") then

                    children = true

                    Response.Write("<ul>")

                end If


If arrPages(0,x) = "" Then

phone = ""

Else

phone = Left(arrPages(0,x), 3) & "****" & Right(arrPages(0,x), 4)

End If


If Len(arrPages(2,x)) > 2 Then

name = Left(arrPages(2,x), 1) & "*" & Mid(arrPages(2,x), 3, Len(arrPages(2,x)))

Else

name = ""

End If

            %>

            <li>

                <%=phone%>, <%=name%>

                <% Call fntree(arrPages(0,x), arrPages) %>

            </li>

<%

            end if

        next


        if (children = true AND parent > "0") then

            Response.Write("</ul>")

        end if


    end function




'배열에 담길 값

'arrList == ID, PID, NAME




    print "<ul>"

print "<li>" & authPartnerID & ", 나"

    Call fntree(authPartnerID, arrList)

    print "</li></ul>"

%>


내용 :



-나

ㄴ아들1

ㄴ손자1

ㄴ증손자1

ㄴ증손자2

ㄴ손자2

ㄴ아들2


를 표현할때 사용함.





예제 소스 파일 :


 출처 :  




Comments