Page 1 of 1

Model .droplink for in-model text

Posted: Fri Jun 06, 2025 5:28 am
by redversjones
I am having trouble programming a file to drop an identity within a model created via @append.

Say I had an identity Z= X+Y within a model object as a text-equation via '[model].append @identity Z=X+Y' and the model object has listed that as Eq3 after an equation for X and Y. Now suppose I want to change that identity for some reason. Before creating my new identity I have to delete the old one (to avoid two equations with the same RHS variable). I can do this manually by clicking on Eq3>right-click>delete and it uses .droplink in the capture window. Coding for an equation object Eq1 I can use '[model].droplink Eq1' but this does not seem to work for text equations such as Eq3 in this example, despite capture window showing droplink is used. Any help would be great?

Happy to provide a file but hopefully the simple example above is enough.
Thank you

Re: Model .droplink for in-model text

Posted: Fri Jun 06, 2025 8:13 am
by EViews Gareth
.droplink is only used to drop linked objects. To drop a variable, use .drop:

Code: Select all

wfcreate m 1990 2020 series y=nrnd series x=nrnd equation eq1.ls y c x series z=nrnd model m m.append :eq1 m.append z=3*x m.drop z m.droplink eq1
As an aside you could always just use .replace to do what you want, I think:

Code: Select all

wfcreate m 1990 2020 series y=nrnd series x=nrnd equation eq1.ls y c x series z=nrnd model m m.append :eq1 m.append z=3*x m.replace z=4*x

Re: Model .droplink for in-model text

Posted: Fri Jun 06, 2025 8:32 am
by redversjones
Superb, thank you