Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Macro substitution method run-time error ???
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Macro substitution method run-time error ???
Divers
Thread ID:
00737157
Message ID:
00737157
Vues:
75
The following is an extract of a procedure that I use to dynamically create a data grid at runtime. Everything works except, the Refresh() with-in the methods. I get an error message. "Unrecognizable Command Verb"

Can one not use macro substitution with-in a method? or do I have a syntax error?

How else can I reference the parent object without using "control.parent.parent". The reason I do not want to use .parent.parent is because at run time, I don't know if the calling program is placing this grid directly on to a form or with-in a pageframe. In other words, I may not want to refresh the whole form, only the parent object of the grid.

===================================================
PARAMETERS pcFORM,pcFORMPAGE,pcGRID,pcTOP,pcBOTTOM


if PEMSTATUS(&pcFORMPAGE, pcGRID, 5)
m.llFirstRun = .F.
&pcFORM..LockScreen = .T.
&pcFORMPAGE..&pcGRID..Visible = .F.
&pcFORMPAGE..RemoveObject(pcGRID)
endif


&pcFORMPAGE..AddObject(pcGRID,'Grid') && create grid

with &pcFORMPAGE..&pcGRID
.Top = &pcFORMPAGE..&pcTOP..Top+1
.Height = &pcFORMPAGE..&pcBottom..TOP - &pcFORMPAGE..&pcTOP..Top
.Width = &pcFORMPAGE..&pcTOP..Width - &pcFORMPAGE..&pcGRID..Left - 4

.RecordSource = 'TRANHIST'
.RecordSourceType = 1 && 1=Alias
.ChildOrder = 'TRANHIST'
.ColumnCount = 28
.FontSize = 8
.DeleteMark = .F.
.ReadOnly = .T.
.RowHeight = 24
.RelationalExpr = 'STR(M1COMPANY,1)+STR(M1POLICY,8)'
.AllowAddNew = .F.



.Column1.ControlSource = .RecordSource+'.THCOMPANY'
with .Column1
.Width = 17
.Header1.Caption = 'CO#'
.Alignment = 3
.ReadOnly = .t.
.AddObject('myText','ReadOnlyTextMethods')
.CurrentControl = 'myText'
.myText.visible = .t.
.Sparse = .t.


.Visible = .T.
endwith


&pcFORMPAGE..&pcGRID..Refresh()


RETURN




define class ReadOnlyTextMethods as TextBox

procedure Click
&pcFORMPAGE..Refresh()
endproc


procedure KeyPress
LPARAMETERS nKeyCode, nShiftAltCtrl
&pcFORMPAGE..Refresh()
endproc

enddefine
Best Regards,
Lee Roy J. Pitre, Jr, AAS, BA, MS
Pitre Computer Consultant & Associates
http://pitres.us
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform