I need to do a progressive migration of an application which has it's roots and code way back in time.
It uses screens rather than forms, and @...SAY and @...GET.
As part of the fuzzy overlap between old and new versions, I've been asked to add a command button to a screen so that a Word document can be created.
The problem I've run into is with NEWOBJECT() versus CREATEOBJECT().
How do I use NEWOBJECT() to add an object to a screen where all I have access to is the screen "handle" ?
The code below works using CREATEOBJECT(), however due to the other transitional bits in the application, I cannot guarantee that the class library will be open, without have to check everywhere with SET("CLASSLIB")...
for i=1 to _screen.formcount
if upper(_screen.forms[i].name) == upper(L_wname)
QQthisform = _screen.forms[i]
endif
endfor
if type("QQthisform.cmdWord") = "O"
QQthisForm.RemoveObject('cmdWord')
endif
if type("QQthisform.cmdWord") <> "O"
QQthisForm.AddObject('cmdWord','cmd_Word')
endif
with QQthisform.cmdWord
.Top=85
.Left=25
.Enabled = .T.
.Visible = .T.
endwith
TIA,
Simon