Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Commanding pages
Message
From
16/07/1998 16:51:05
 
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00117842
Message ID:
00118360
Views:
19
I think I see the problem, but not how to fix it.

This line: .AddObject(lcPageName,"TripPage")
that I thought was working despite the syntax error actually isn't. So when it sets the captions, it's doing it on the original 2 pages that are there automatically. So that's why it's not finding "RecordNo".

So does anyone know what the syntax error is? If I can fix that, it should work.

Thanks,

-Michelle


>Ok, here's what I did:
>
>This is in a .prg file:
>
>DEFINE CLASS TripPage AS Page
>...RecordNo = 0
>...PROCEDURE Activate
>......SELECT trips
>......GO RecordNo
>......this.refresh()
>...ENDPROC
>ENDDEFINE
>
>
>
>This is what I have to set up the pages:
>
>LOCAL lcPageName, i
>i = 1
>
>SELECT trips
>SCAN FOR trips.igroup = thisform.group
>...lcPageName = "Page"+str(i)
>...WITH thisform.tsPageFrame1
>..... .AddObject(lcPageName,"TripPage")
>..... .pages[i].RecordNo = RECNO()
>..... .pages[i].caption = trips.cname
>...ENDWITH
>...i = i + 1
>...SELECT trips
>ENDSCAN
>thisform.refresh
>
>.AddObject(lcPageName,"TripPage") gives me a syntax error, but it does it anyway.
>
>.pages[i].RecordNo = RECNO() tells me there's no such property as RecordNo, and doesn't do it anyway.
>
>.pages[i].caption = trips.cname works properly.
>
>Any ideas?
>
>Thanks,
>
>-Michelle
>
>
>
>>The short answer is that you can't. You can, however, create a page class in a prg file and use that to add pages to your pageframe.
>>
>>
>>* MyPages.prg
>>DEFINE CLASS MyPage AS Page
>>  PROCEDURE Activate
>>     * Put your code here
>>
>>  ENDPROC
>>ENDDEFINE
>>
>>
>>Then when you want to add pages to a pagefraem at runtime you can;
>>
>>
>>IF NOT "MyPages.prg" $ SET("PROCEDURE")
>>   SET PROCEDURE TO MyPages.prg ADDITIVE
>>ENDIF
>>THISFORM.PageFrame1.AddObject("PageName","MyPage")
>>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform