Model .droplink for in-model text

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

redversjones
Posts: 8
Joined: Thu Dec 07, 2017 10:11 am

Model .droplink for in-model text

Postby redversjones » Fri Jun 06, 2025 5:28 am

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

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13598
Joined: Tue Sep 16, 2008 5:38 pm

Re: Model .droplink for in-model text

Postby EViews Gareth » Fri Jun 06, 2025 8:13 am

.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

redversjones
Posts: 8
Joined: Thu Dec 07, 2017 10:11 am

Re: Model .droplink for in-model text

Postby redversjones » Fri Jun 06, 2025 8:32 am

Superb, thank you


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests