Hmmm.
Could you repost with an indication of just where the endtry appears?
Can you make the code reliable by sending the alias as a 4th parameter? ie
cALias = alias()
thisform.Pframebase1.Page2.NewObject('Gridouter1','Gridouter','mmclasscode.prg',
cAlias)
etc...
What happens when you set a watch on the alias() function?
I assume gridouter1 is a grid object... Aren't there conditions where creating
a grid that references an alias
selects that alias or selects 0 even momentarily before its alias is assigned?
Do the columns of the grid have control sources already set at the time of
creation or do you set them in code
later? What happens when you switch these methods?
When you step through does the pageframe activepage change? Do any uienable's
that have code in them fire?
-Lew
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Andy Davies
Sent: Thursday, June 14, 2007 7:15 AM
To: [email protected]
Subject: wrong alias - try again
Has anyone come across this - I have some code where just occasionally the
alias() gets changed:
** myform.someButton.Click
SELECT curMembers
* snip some set form properties code
TRY
thisform.Pframebase1.Page2.NewObject('Gridouter1','Gridouter','mmclasscode.prg')
CATCH TO oException
** mmclasscode gridouter.init
PROCEDURE Init
PARAMETERS pcTablename, pcClass, pcClassLib
* parms not used in this example
LOCAL cRowClass as String, cErr as string
WITH THIS
IF TYPE('pcTablename') = 'C' AND NOT EMPTY(pcTablename)
.Table = pcTablename
ELSE
.Table = ALIAS()
ENDIF
*** nine times out of ten at this point .Table = 'curMembers'
*** - the tenth time it is a different (existing) cursor name
Andrew Davies MBCS CITP
- AndyD 8-)#
[excessive quoting removed by server]
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.