Passing a subroutine to another

For questions regarding programming in the EViews programming language.

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

paues
Posts: 201
Joined: Fri Apr 15, 2011 7:16 am
Location: Stockholm, Sweden

Passing a subroutine to another

Postby paues » Sun Feb 01, 2026 12:13 am

Is it possible to pass a subroutine as an argument to another subroutine? That is, something like

Code: Select all

call subA("subB") subroutine subA(string %f) call {%f} endsub subroutine subB @uiprompt("success!") endsub
or

Code: Select all

call subA(subB) subroutine subA(subroutine f) call f endsub subroutine subB @uiprompt("success!") endsub

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

Re: Passing a subroutine to another

Postby EViews Gareth » Mon Feb 02, 2026 9:24 am

I believe because all subroutine loading is done as a pre-processing step before any other part of the program, this is not possible.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests