Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with when I add a Page Dynamic

Status
Not open for further replies.

RedLion

Programmer
Sep 13, 2000
342
NL
Hello,

I would like to dynamic add a page to a pageframe, but the problem how to reference to the new added page, because it's not an array?

&& Source

LOCAL lnCounter, laContactpersonen, lcNaam
THIS.oClub.getPersonen(@laContactpersonen) && Array with all people to add, each on a seperate page.
THIS.nAantalContactpersonen = ALEN(laContactpersonen,1) && count the people in the array.
FOR lnCounter = 1 TO THIS.nAantalContactpersonen
lcNaam = "ContactPersoon" + STR(lnCounter) && Name of the new page
THIS.pgfClub.PAGECOUNT = lnCounter + 4
THIS.pgfClub(lnTeller + 4).NAME = lcNaam && Here I got the error that it is not an array?????????? How can I acces it without an array?
WITH THIS.pgfClub
.&lcNaam..PAGEORDER = 2 + lnTeller
.&lcNaam..ADDOBJECT('o' + lcNaam,'CONTACTPERSOON',laContactpersonen(lnCounter,1) && The new page has an custom object myObject, not important
.&lcNaam..&'o' + lcNaam..txtNaam.VALUE = laContactpersonen(lnCounter,2)
.&lcNaam..&'o' + lcNaam..txtTel.VALUE = laContactpersonen(lnCounter,3)
.&lcNaam..&'o' + lcNaam..txtMobiel.VALUE = laContactpersonen(lnCounter,4)
.&lcNaam..&'o' + lcNaam..txtEmail.VALUE = laContactpersonen(lnCounter,5)
ENDWITH
ENDFOR


How to get it work?

Thanks,

Charl
 
Instead of enlarging the pagecount you can also use:

pageframe.addobject('Naam', 'page') in which you can establish the naming of the page.



Weedz
veld4663@exact.nl

'It never hurts to help...' - Eek the cat.
 
Oops, your mistake is:

THIS.pgfClub(lnTeller + 4).NAME , this should be

THIS.pgfClub.PAGES[lnTeller + 4].Name = 'Naam'

Hoop dat dit helpt,


Weedz
veld4663@exact.nl

'It never hurts to help...' - Eek the cat.
 
Thanks Weedz,

Both tips are working. Because I didn't saw anywhere that you could make an object page, only pageframe I was working on the other solution.

Only one problem occurred, when I go from my static first page to one of the dynamic pages I get the error "Fatal Error: Exception code=C00000005" Looked in the MSDN, there they say at Q253938 that it is a known bug with cursors and workarears, but not with dynamic objects????

But when you go from my second static page to one of the dynamic pages no error occurred VERY STRANGE!!!!!!!!!!!

What to do know?

In the deactivate-event of my first static page I put the code THISFORM.pgfClub.ACTIVEPAGE = 2 (with lockscreen), so when you click on a dynamic page from there it first calls my second static page so the error my not occur, when I try it the error also occurred, probebly it triggers something at the dynamic page before my second static page got active.

What to do know?????????????


Thanks,

Prettig weekend.

Charl
 
The "Fatal Error: Exception code=C00000005" is a known bug that occurs when no other error number can be used. So it is some sort of mysterious error that can pop up once in a while.

They (MS) said that it should have been solved in VFP60 SP4.

I heard also that it has got something to do with too many variables, both inside VFP and in the developers code...but who knows...

Weedz (The Grassman)
veld4663@exact.nl

'It never hurts to help...' - Eek the cat.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top