Flexible number of arguments

For questions regarding programming in the EViews programming language.

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

tho_mi
Posts: 61
Joined: Sat May 12, 2012 2:41 am

Flexible number of arguments

Postby tho_mi » Mon Mar 19, 2018 11:43 am

Hey,

I have a program that extracts certain information of different matrices. I want it to be flexible and take as many matrices as the user wants. Is there a way to use a "flexible" number of arguments and let the program figure out how many arguments it got?

Thanks in advance!

Best,
Thomas

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

Re: Flexible number of arguments

Postby EViews Gareth » Mon Mar 19, 2018 12:35 pm

All EViews programs have a flexible number of arguments, so it isn't really clear what you're asking.
Follow us on Twitter @IHSEViews

startz
Non-normality and collinearity are NOT problems!
Posts: 3775
Joined: Wed Sep 17, 2008 2:25 pm

Re: Flexible number of arguments

Postby startz » Mon Mar 19, 2018 1:12 pm

If you are running a program, %arg is a string with all the arguments separated by spaces. There isn't an equivalent for subroutines. It might be nice to have the equivalent of Matlab's nargin and vargin, but I don't think EViews has one.

tho_mi
Posts: 61
Joined: Sat May 12, 2012 2:41 am

Re: Flexible number of arguments

Postby tho_mi » Mon Mar 19, 2018 2:22 pm

EViews Gareth wrote:All EViews programs have a flexible number of arguments, so it isn't really clear what you're asking.


Sorry, should've formulated my question in a different way. My question was more about finding out how many arguments the user passed to the program.

startz wrote:If you are running a program, %arg is a string with all the arguments separated by spaces. There isn't an equivalent for subroutines. It might be nice to have the equivalent of Matlab's nargin and vargin, but I don't think EViews has one.


Thanks, that really helps. I'll just use @wcount to get the number of arguments and then extract them (using @word).


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 24 guests