GetList (library program to handle lists)

For questions about EViews Add-ins available from the EViews Add-ins webpage. Note each add-in available on our webpage will have its own individual thread.

Moderators: EViews Gareth, EViews Moderator, EViews Esther

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

GetList (library program to handle lists)

Postby EViews Gareth » Tue Aug 03, 2010 2:05 pm

This thread is about the GetList library. This library asks the end-user for a string list. The user can enter a number of different things:
  • A manual list, e.g.:
    "hello world"
    in which case the subroutine just returns the entered list.
  • The name of a table object in the workfile, in which case the subroutine will return a list containing the entries in the first column of the table, up until the first empty row
  • The name of a svector object in the workfile, in which case the subroutine will return a list containing the entries in the svector
  • The name of a text file (txt) on disk, in which case the subroutine will return a list containing the first "column" of the text file, where columns are delimited by tabs.
  • The name of a csv file on disk, in which case the subroutine will return a list containing the first "column" of the csv file, where columns are delimited by commas.
  • The name of an Excel file (either .xls or .xlsx), in which case the subroutine will return a list containing the entries in the first column (A)


As an example, the attached Excel file can be converted to a string variable with the following code (where you enter the path/name of the Excel file in the dialog that pops up):

Code: Select all


include getlist.prg
create u 1

%test = ""
call getlistdlg(%test, "Enter the name of a table object, an SVector object, a text file or an Excel file, or just enter a list")
statusline {%test}
string aa
aa = %test
show aa
Attachments
test.xls
(16.5 KiB) Downloaded 838 times
Follow us on Twitter @IHSEViews

Return to “Add-in Support”

Who is online

Users browsing this forum: No registered users and 18 guests