>I have created a child class off of the class PAGE. I then wanted my program to automatically create the new pages as needed, but I need the page names to be different from each other.
>
>Example:
>
>DEFINE CLASS mypage AS Page && Creates a Child of PAGE
> Visible = .T.
> PROCEDURE Click
> ...[code]...
> ENDPROC
>ENDDEFINE
>
>******* Addobject test1.*****
>tt = "PAGE"+STR(thisform.pageframe1.PageCount+1)
>thisform.pageframe1.addobject(tt, 'mypage')
>&& it gives the error: Not property of...
>
>******* Addobject test2 (Code read from thread) *****
>WITH THISFORM.PageFrame1
>lcNextPage = ALLTRIM(STR(.PageCount+1))
>.addobject(lcNextPage, 'MyPage')
>ENDWITH
>&& this gives me a syntax error
>
>What can I do to create a new page with unique name dynamically?
Use this:
WITH THISFORM.PageFrame1
lcNextPage ="Page"+ALLTRIM(STR(.PageCount+1))
.addobject(lcNextPage, 'MyPage')
ENDWITH
Edward Pikman
Independent Consultant