Finding max and min of scalar objects

For questions regarding programming in the EViews programming language.

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

gmcatee
Posts: 9
Joined: Wed Oct 29, 2014 8:28 am

Finding max and min of scalar objects

Postby gmcatee » Wed Oct 29, 2014 8:51 am

Is there an EViews function that will find the max/min/etc of a set of scalar values? The @max command is only valid for series objects. I can think of roundabout ways to do this (copy all scalars to a series and then use @max or use a bunch of indicator functions) but I wanted to know if this feature was already available.

Also, a general question -- if I can't find a function, is there a way I can program my own function, such as @maxnum(scalar1, scalar2, ...), and then call that from the command window or within any command file I write? Not by using a subroutine or creating a separate .prg file but embed it inside of my copy of EViews?

Here is an example of how I intend to use this:

Code: Select all

!scalar1 = 10 ' a scalar object determined previously in the code !scalar2 = 20 ' a scalar object determined previously in the code for !i = @maxnum(5,!scalar1) to @minnum(15,!scalar2) ...
Thanks

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

Re: Finding max and min of scalar objects

Postby EViews Gareth » Wed Oct 29, 2014 9:19 am

There isn't that function.

You cannot create your own functions (outside of add-ins, of course).

I'd recommend putting them into a vector rather than a series.

gmcatee
Posts: 9
Joined: Wed Oct 29, 2014 8:28 am

Re: Finding max and min of scalar objects

Postby gmcatee » Mon Nov 03, 2014 9:37 am

Great, thanks for your help Gareth


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests